Fix for do_next_word and screen updates

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@357 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2000-12-01 23:49:48 +00:00
parent 4eb7aa04f3
commit 9e2934fd27
3 changed files with 45 additions and 29 deletions

View File

@ -53,6 +53,10 @@ CVS code -
nano_small_msg(), nano_disabled_msg() nano_small_msg(), nano_disabled_msg()
- Added checks for disabled functions to see whether or not to - Added checks for disabled functions to see whether or not to
declare them. declare them.
do_next_word()
- Update the previous line as well as the current one in case we
have moved beyond COLS or back from COLS, patch submitted
by Ryan Krebs.
- search.c: - search.c:
do_replace_hilight() do_replace_hilight()
- New function, displays the currently selected word as hilighted - New function, displays the currently selected word as hilighted

14
nano.c
View File

@ -610,12 +610,13 @@ int do_enter_void(void)
void do_next_word(void) void do_next_word(void)
{ {
filestruct *fileptr; filestruct *fileptr, *old;
int i; int i;
if (current == NULL) if (current == NULL)
return; return;
old = current;
i = current_x; i = current_x;
for (fileptr = current; fileptr != NULL; fileptr = fileptr->next) { for (fileptr = current; fileptr != NULL; fileptr = fileptr->next) {
if (fileptr == current) { if (fileptr == current) {
@ -643,8 +644,19 @@ void do_next_word(void)
current_x = i; current_x = i;
placewewant = xplustabs(); placewewant = xplustabs();
if (current->lineno >= editbot->lineno) if (current->lineno >= editbot->lineno)
edit_update(current, CENTER); edit_update(current, CENTER);
else {
/* If we've jumped lines, refresh the old line. We can't just use
* current->prev here, because we may have skipped over some blank
* lines, in which case the previous line is the wrong one.
*/
if (current != old)
update_line(old, 0);
update_line(current, current_x);
}
} }

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-12-01 13:55-0500\n" "POT-Creation-Date: 2000-12-01 18:47-0500\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"
@ -55,7 +55,7 @@ msgstr ""
msgid "File to insert [from ./] " msgid "File to insert [from ./] "
msgstr "" msgstr ""
#: files.c:284 files.c:309 files.c:517 nano.c:1397 #: files.c:284 files.c:309 files.c:517 nano.c:1409
msgid "Cancelled" msgid "Cancelled"
msgstr "" msgstr ""
@ -627,116 +627,116 @@ msgstr ""
msgid "Mark UNset" msgid "Mark UNset"
msgstr "" msgstr ""
#: nano.c:918 #: nano.c:930
#, c-format #, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n" msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr "" msgstr ""
#: nano.c:969 #: nano.c:981
#, c-format #, c-format
msgid "current->data now = \"%s\"\n" msgid "current->data now = \"%s\"\n"
msgstr "" msgstr ""
#: nano.c:1022 #: nano.c:1034
#, c-format #, c-format
msgid "After, data = \"%s\"\n" msgid "After, data = \"%s\"\n"
msgstr "" msgstr ""
#: nano.c:1122 #: nano.c:1134
msgid "Edit a replacement" msgid "Edit a replacement"
msgstr "" msgstr ""
#: nano.c:1346 #: nano.c:1358
#, c-format #, c-format
msgid "Could not create a temporary filename: %s" msgid "Could not create a temporary filename: %s"
msgstr "" msgstr ""
#: nano.c:1362 #: nano.c:1374
msgid "Finished checking spelling" msgid "Finished checking spelling"
msgstr "" msgstr ""
#: nano.c:1364 #: nano.c:1376
msgid "Spell checking failed" msgid "Spell checking failed"
msgstr "" msgstr ""
#: nano.c:1384 #: nano.c:1396
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? " msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr "" msgstr ""
#: nano.c:1547 #: nano.c:1559
msgid "Cannot resize top win" msgid "Cannot resize top win"
msgstr "" msgstr ""
#: nano.c:1549 #: nano.c:1561
msgid "Cannot move top win" msgid "Cannot move top win"
msgstr "" msgstr ""
#: nano.c:1551 #: nano.c:1563
msgid "Cannot resize edit win" msgid "Cannot resize edit win"
msgstr "" msgstr ""
#: nano.c:1553 #: nano.c:1565
msgid "Cannot move edit win" msgid "Cannot move edit win"
msgstr "" msgstr ""
#: nano.c:1555 #: nano.c:1567
msgid "Cannot resize bottom win" msgid "Cannot resize bottom win"
msgstr "" msgstr ""
#: nano.c:1557 #: nano.c:1569
msgid "Cannot move bottom win" msgid "Cannot move bottom win"
msgstr "" msgstr ""
#: nano.c:1845 #: nano.c:1857
msgid "Can now UnJustify!" msgid "Can now UnJustify!"
msgstr "" msgstr ""
#: nano.c:1940 #: nano.c:1952
#, c-format #, c-format
msgid "%s enable/disable" msgid "%s enable/disable"
msgstr "" msgstr ""
#: nano.c:1952 #: nano.c:1964
msgid "enabled" msgid "enabled"
msgstr "" msgstr ""
#: nano.c:1953 #: nano.c:1965
msgid "disabled" msgid "disabled"
msgstr "" msgstr ""
#: nano.c:2183 #: nano.c:2195
msgid "Main: set up windows\n" msgid "Main: set up windows\n"
msgstr "" msgstr ""
#: nano.c:2196 #: nano.c:2208
msgid "Main: bottom win\n" msgid "Main: bottom win\n"
msgstr "" msgstr ""
#: nano.c:2202 #: nano.c:2214
msgid "Main: open file\n" msgid "Main: open file\n"
msgstr "" msgstr ""
#: nano.c:2239 #: nano.c:2251
#, c-format #, c-format
msgid "I got Alt-O-%c! (%d)\n" msgid "I got Alt-O-%c! (%d)\n"
msgstr "" msgstr ""
#: nano.c:2261 #: nano.c:2273
#, c-format #, c-format
msgid "I got Alt-[-1-%c! (%d)\n" msgid "I got Alt-[-1-%c! (%d)\n"
msgstr "" msgstr ""
#: nano.c:2294 #: nano.c:2306
#, c-format #, c-format
msgid "I got Alt-[-2-%c! (%d)\n" msgid "I got Alt-[-2-%c! (%d)\n"
msgstr "" msgstr ""
#: nano.c:2342 #: nano.c:2354
#, c-format #, c-format
msgid "I got Alt-[-%c! (%d)\n" msgid "I got Alt-[-%c! (%d)\n"
msgstr "" msgstr ""
#: nano.c:2368 #: nano.c:2380
#, c-format #, c-format
msgid "I got Alt-%c! (%d)\n" msgid "I got Alt-%c! (%d)\n"
msgstr "" msgstr ""