From: Chris Allegretta Date: Sat, 2 Sep 2000 07:55:41 +0000 (+0000) Subject: update_line(): Added check for binary data >= 1 and <= 26, and use ^+letter ot displ... X-Git-Tag: v0.9.17~6 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6306a11ad61fc0c2599e77d74270916208eddfa3;p=nano.git update_line(): Added check for binary data >= 1 and <= 26, and use ^+letter ot display it git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@197 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index a1ec8a58..349d99e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,11 @@ CVS Code lack of reversed text on searching with MARK_ISSET. onekey() - Off by one error fix (Rocco Corsi). + update_line() + - Added check for binary data >= 1 and <= 26, and use ^+letter + to display it. Should fix editing text files with binary + data in them. Placing of the cursor seems to be a bit screwed + though... - search.c: search_abort() - Now calls edit_refresh_clearok when MARK_ISSET to handle screen diff --git a/po/nano.pot b/po/nano.pot index 8595f305..36e75a36 100644 --- a/po/nano.pot +++ b/po/nano.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-09-02 03:33-0400\n" +"POT-Creation-Date: 2000-09-02 04:01-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -380,7 +380,7 @@ msgid "Case Sens" msgstr "" #: global.c:331 global.c:350 global.c:360 global.c:376 global.c:380 -#: global.c:386 winio.c:994 +#: global.c:386 winio.c:999 msgid "Cancel" msgstr "" @@ -796,50 +796,50 @@ msgstr "" msgid "Modified" msgstr "" -#: winio.c:910 +#: winio.c:915 #, c-format msgid "Moved to (%d, %d) in edit buffer\n" msgstr "" -#: winio.c:921 +#: winio.c:926 #, c-format msgid "current->data = \"%s\"\n" msgstr "" -#: winio.c:964 +#: winio.c:969 #, c-format msgid "I got \"%s\"\n" msgstr "" -#: winio.c:989 +#: winio.c:994 msgid "Yes" msgstr "" -#: winio.c:991 +#: winio.c:996 msgid "All" msgstr "" -#: winio.c:993 +#: winio.c:998 msgid "No" msgstr "" -#: winio.c:1129 +#: winio.c:1134 #, c-format msgid "do_cursorpos: linepct = %f, bytepct = %f\n" msgstr "" -#: winio.c:1133 +#: winio.c:1138 msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)" msgstr "" -#: winio.c:1257 +#: winio.c:1262 msgid "Dumping file buffer to stderr...\n" msgstr "" -#: winio.c:1259 +#: winio.c:1264 msgid "Dumping cutbuffer to stderr...\n" msgstr "" -#: winio.c:1261 +#: winio.c:1266 msgid "Dumping a buffer to stderr...\n" msgstr "" diff --git a/winio.c b/winio.c index 746fe3a7..b0f1449d 100644 --- a/winio.c +++ b/winio.c @@ -780,6 +780,11 @@ void update_line(filestruct * fileptr, int index) virt_cur_x--; if (i < mark_beginx) virt_mark_beginx--; + } + else if (realdata[i] >= 1 && realdata[i] <= 26) { + /* Treat control characters as ^letter */ + fileptr->data[pos++] = '^'; + fileptr->data[pos++] = realdata[i] + 64; } else { fileptr->data[pos++] = realdata[i]; }