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
This commit is contained in:
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.
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

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@ -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];
}