Code

screen_keydef: save lw->start when switching view modes
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 28 Dec 2011 22:14:27 +0000 (23:14 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 28 Dec 2011 22:14:27 +0000 (23:14 +0100)
src/screen_keydef.c

index 083696460a81cc3215985bdbd40c2229711be94d..f31e6c5542c09a554486e128c6687e56eee7f1cb 100644 (file)
@@ -159,11 +159,16 @@ keydef_repaint(void)
        wrefresh(lw->w);
 }
 
+/** lw->start the last time switch_to_subcmd_mode() was called */
+static unsigned saved_start = 0;
+
 static void
 switch_to_subcmd_mode(int cmd)
 {
        assert(subcmd == -1);
 
+       saved_start = lw->start;
+
        subcmd = cmd;
        list_window_reset(lw);
        check_subcmd_length();
@@ -180,6 +185,8 @@ switch_to_command_mode(void)
        list_window_set_cursor(lw, subcmd);
        subcmd = -1;
 
+       lw->start = saved_start;
+
        keydef_repaint();
 }