diff --git a/ChangeLog b/ChangeLog index 59ec727a910cc78ac10d0541dc3a4e5f525b478a..92e42dee21e3149311e5168b101548bbf82aa16a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-03 Chris Allegretta <chrisa@asty.org> + * global.c (shortcut_init): Fix up/down keys not responding in the file browser, + discovered by Hannes <mr_creosote@mutantwatch.de>. + * move.c (do_up) - Fix another scrolling issue with softwrap when the + cursor is beyond COLS, discovered by Hannes <mr_creosote@mutantwatch.de>. + 2009-09-02 Chris Allegretta <chrisa@asty.org> * Attempt to check file writability and emit a warning on the status bar if nano doesn't think the file can be written to. Feature originally diff --git a/src/global.c b/src/global.c index dbd42091103a2367a2f980aa89d26eeed3804961..c7f8ea1ee7a729dc99d036bc14d031addd70e14f 100644 --- a/src/global.c +++ b/src/global.c @@ -1079,10 +1079,10 @@ 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(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(MMAIN|MBROWSER, "^P", DO_UP_VOID, 0, TRUE); + add_to_sclist(MMAIN|MBROWSER, "kup", DO_UP_VOID, 0, TRUE); + add_to_sclist(MMAIN|MBROWSER, "^N", DO_DOWN_VOID, 0, TRUE); + add_to_sclist(MMAIN|MBROWSER, "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); diff --git a/src/move.c b/src/move.c index fba776b4182b2d88d6c438008c5b4b21cc8afdf6..737404dec9fe07682bdbc3d56c09605da9d44152 100644 --- a/src/move.c +++ b/src/move.c @@ -488,7 +488,7 @@ void do_up( ) return; - assert(openfile->current_y == openfile->current->lineno - openfile->edittop->lineno); + assert(ISSET(SOFTWRAP) || openfile->current_y == openfile->current->lineno - openfile->edittop->lineno); /* Move the current line of the edit window up. */ openfile->current = openfile->current->prev; @@ -500,7 +500,7 @@ void do_up( * smooth scrolling mode, or up half a page if we're not. If * scroll_only is TRUE, scroll the edit window up one line * unconditionally. */ - if (openfile->current_y == 0 + if (openfile->current_y == 0 || (ISSET(SOFTWRAP) && openfile->edittop->lineno == openfile->current->next->lineno) #ifndef NANO_TINY || scroll_only #endif