Add a fix for bug #23144 that actually works (several bugs in one here)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4264 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2008-06-03 08:09:05 +00:00
parent 1371fb6326
commit 1b6ed07543
5 changed files with 18 additions and 10 deletions

View File

@ -1,6 +1,6 @@
2008-05-31 Chris Allegretta <chrisa@asty.org>
* prompt.c: Tentative fix for bug #23144: using arrow keys in
search buffer affects main window (by Mike Frysinger)
* prompt.c,search.c,global.c: Tentative fix for bug #23144: using arrow
keys in search buffer affects main window (by Mike Frysinger)
2008-05-31 Chris Allegretta <chrisa@asty.org>
* global.c: Fix for Savannah bug #23442: left/right arrow keys

View File

@ -1064,15 +1064,21 @@ void shortcut_init(bool unjustify)
add_to_sclist(MALL, "kleft", do_left, 0, TRUE);
add_to_sclist(MMAIN, "^Q", xon_complaint, 0, TRUE);
add_to_sclist(MMAIN, "^S", xoff_complaint, 0, TRUE);
add_to_sclist(MALL, "^P", do_up_void, 0, TRUE);
add_to_sclist(MALL, "kup", do_up_void, 0, TRUE);
add_to_sclist(MALL, "^N", do_down_void, 0, TRUE);
add_to_sclist(MALL, "kdown", do_down_void, 0, TRUE);
add_to_sclist(MMAIN, "^P", do_up_void, 0, TRUE);
add_to_sclist(MMAIN, "kup", do_up_void, 0, TRUE);
add_to_sclist(MMAIN, "^N", do_down_void, 0, TRUE);
add_to_sclist(MMAIN, "kdown", do_down_void, 0, TRUE);
add_to_sclist(MALL, "^A", do_home, 0, TRUE);
add_to_sclist(MALL, "khome", do_home, 0, TRUE);
add_to_sclist(MALL, "^E", do_end, 0, TRUE);
add_to_sclist(MALL, "kend", do_end, 0, TRUE);
#ifndef DISABLE_JUSTIFY
#ifndef NANO_TINY
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "^P", (void *) prev_history_msg, 0, FALSE);
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "kup", (void *) prev_history_msg, 0, FALSE);
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "^N", (void *) next_history_msg, 0, FALSE);
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "kdown", (void *) next_history_msg, 0, FALSE);
#endif
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,
"^W", do_para_begin_void, 0, TRUE);
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,

View File

@ -1010,7 +1010,7 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %d\n", answer
} else
#endif /* !DISABLE_TABCOMP */
#ifndef NANO_TINY
if (s && s->scfunc == do_up_void) {
if (s && s->scfunc == (void *) prev_history_msg) {
if (history_list != NULL) {
/* If we're scrolling up at the bottom of the
* history list and answer isn't blank, save answer
@ -1038,7 +1038,7 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %d\n", answer
* statusbar prompt. */
finished = FALSE;
}
} else if (s && s->scfunc == do_down_void) {
} else if (s && s->scfunc == (void *) next_history_msg) {
if (history_list != NULL) {
/* Get the newer search from the history list and
* save it in answer. If there is no newer search,

View File

@ -788,6 +788,8 @@ const char *cancel_msg;
#ifndef NANO_TINY
const char *case_sens_msg;
const char *backwards_msg;
const char *prev_history_msg;
const char *next_history_msg;
#endif
const char *replace_msg;
const char *no_replace_msg;

View File

@ -1383,7 +1383,7 @@ char *get_history_older(filestruct **h)
assert(h != NULL);
if ((*h)->prev == NULL)
return (*h)->data;
return NULL;
*h = (*h)->prev;
@ -1397,7 +1397,7 @@ char *get_history_newer(filestruct **h)
assert(h != NULL);
if ((*h)->next == NULL)
return (*h)->data;
return NULL;
*h = (*h)->next;