Code

screen_keydef: Fixed selections on key bindings screen
authorJeffrey Middleton <jefromi@gmail.com>
Fri, 6 Mar 2009 01:02:07 +0000 (19:02 -0600)
committerJeffrey Middleton <jefromi@gmail.com>
Thu, 5 Mar 2009 19:17:35 +0000 (13:17 -0600)
Key bindings screen uses struct list_window, so the addition of visual
mode requires setting selection_start and selection_end to match
selection, even though visual mode serves no purpose there currently.

src/screen_keydef.c

index 92837991083e8dc603ec96859123066fdebaa18f..d5f12f8aab66adea648a4ffc496fe599896c455a 100644 (file)
@@ -316,6 +316,8 @@ keydef_cmd(G_GNUC_UNUSED mpdclient_t *c, command_t cmd)
                        } else {
                                subcmd = lw->selected;
                                lw->selected=0;
+                               lw->selected_start = lw->selected;
+                               lw->selected_end = lw->selected;
                                check_subcmd_length();
 
                                keydef_repaint();
@@ -323,6 +325,8 @@ keydef_cmd(G_GNUC_UNUSED mpdclient_t *c, command_t cmd)
                } else {
                        if (lw->selected == 0) { /* up */
                                lw->selected = subcmd;
+                               lw->selected_start = lw->selected;
+                               lw->selected_end = lw->selected;
                                subcmd = -1;
 
                                keydef_repaint();