Code

screen_browser: select next item after select/add
authorMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 16:20:42 +0000 (18:20 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 3 Oct 2009 16:20:42 +0000 (18:20 +0200)
Commit d08e14fa broke this: previously, the assignment
"cmd=CMD_LIST_NEXT" was passed to list_window_cmd().  With this patch,
list_window_cmd() was called before.  Thanks to Thomas Jansen for
finding this one.

src/screen_browser.c

index 851f18cad6189812ed08cd09af43c72cf2297c55..604d424e30746120e75f5c866b2aa2fa93d37de7 100644 (file)
@@ -465,19 +465,17 @@ browser_cmd(struct screen_browser *browser,
 
        case CMD_SELECT:
                if (browser_handle_select(browser, c))
-                       /* continue and select next item... */
-                       cmd = CMD_LIST_NEXT;
-
-               /* call list_window_cmd to go to the next item */
-               break;
+                       list_window_cmd(browser->lw,
+                                       filelist_length(browser->filelist),
+                                       CMD_LIST_NEXT);
+               return true;
 
        case CMD_ADD:
                if (browser_handle_add(browser, c))
-                       /* continue and select next item... */
-                       cmd = CMD_LIST_NEXT;
-
-               /* call list_window_cmd to go to the next item */
-               break;
+                       list_window_cmd(browser->lw,
+                                       filelist_length(browser->filelist),
+                                       CMD_LIST_NEXT);
+               return true;
 
        case CMD_SELECT_ALL:
                browser_handle_select_all(browser, c);