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
master
Chris Allegretta 2000-09-02 07:55:41 +00:00
parent 9541f2a1d3
commit 6306a11ad6
3 changed files with 23 additions and 13 deletions

View File

@ -27,6 +27,11 @@ CVS Code
lack of reversed text on searching with MARK_ISSET. lack of reversed text on searching with MARK_ISSET.
onekey() onekey()
- Off by one error fix (Rocco Corsi). - 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.c:
search_abort() search_abort()
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen - Now calls edit_refresh_clearok when MARK_ISSET to handle screen

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -380,7 +380,7 @@ msgid "Case Sens"
msgstr "" msgstr ""
#: global.c:331 global.c:350 global.c:360 global.c:376 global.c:380 #: 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" msgid "Cancel"
msgstr "" msgstr ""
@ -796,50 +796,50 @@ msgstr ""
msgid "Modified" msgid "Modified"
msgstr "" msgstr ""
#: winio.c:910 #: winio.c:915
#, c-format #, c-format
msgid "Moved to (%d, %d) in edit buffer\n" msgid "Moved to (%d, %d) in edit buffer\n"
msgstr "" msgstr ""
#: winio.c:921 #: winio.c:926
#, c-format #, c-format
msgid "current->data = \"%s\"\n" msgid "current->data = \"%s\"\n"
msgstr "" msgstr ""
#: winio.c:964 #: winio.c:969
#, c-format #, c-format
msgid "I got \"%s\"\n" msgid "I got \"%s\"\n"
msgstr "" msgstr ""
#: winio.c:989 #: winio.c:994
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: winio.c:991 #: winio.c:996
msgid "All" msgid "All"
msgstr "" msgstr ""
#: winio.c:993 #: winio.c:998
msgid "No" msgid "No"
msgstr "" msgstr ""
#: winio.c:1129 #: winio.c:1134
#, c-format #, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n" msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr "" msgstr ""
#: winio.c:1133 #: winio.c:1138
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)" msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr "" msgstr ""
#: winio.c:1257 #: winio.c:1262
msgid "Dumping file buffer to stderr...\n" msgid "Dumping file buffer to stderr...\n"
msgstr "" msgstr ""
#: winio.c:1259 #: winio.c:1264
msgid "Dumping cutbuffer to stderr...\n" msgid "Dumping cutbuffer to stderr...\n"
msgstr "" msgstr ""
#: winio.c:1261 #: winio.c:1266
msgid "Dumping a buffer to stderr...\n" msgid "Dumping a buffer to stderr...\n"
msgstr "" msgstr ""

View File

@ -780,6 +780,11 @@ void update_line(filestruct * fileptr, int index)
virt_cur_x--; virt_cur_x--;
if (i < mark_beginx) if (i < mark_beginx)
virt_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 { } else {
fileptr->data[pos++] = realdata[i]; fileptr->data[pos++] = realdata[i];
} }