From: Jeffrey Middleton Date: Tue, 3 Mar 2009 22:15:19 +0000 (+0100) Subject: list_window: Tweaked visual mode behavior X-Git-Tag: release-0.14~83 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=966fff945d6662440fc87580d6e04b91575c684b;p=ncmpc.git list_window: Tweaked visual mode behavior Tweaked visual mode behavior so that the start of a visual selection is always one end of it when making large movements (page up/down, H/M/L, home/end). To clarify, suppose you start at the middle of the screen, in visual mode, then: (1) get to the bottom with j (2) go to the top with page up (3) go back to one above middle with j (4) j once more Previously, the resulting selection would be (1) middle to bottom, (2) top to bottom, (3) one above middle to bottom, and (4) middle only. With the change, we will get the intuitive (1) middle to bottom, (2) top to middle, (3) one above middle to middle, and (4) middle only. --- diff --git a/src/list_window.c b/src/list_window.c index bf0f45a..8d1a2d5 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -123,9 +123,15 @@ list_window_set_selected(struct list_window *lw, unsigned n) if(lw->visual_selection) { if(n >= lw->visual_base) + { lw->selected_end = n; + lw->selected_start = lw->visual_base; + } if(n <= lw->visual_base) + { lw->selected_start = n; + lw->selected_end = lw->visual_base; + } } else {