From 966fff945d6662440fc87580d6e04b91575c684b Mon Sep 17 00:00:00 2001 From: Jeffrey Middleton Date: Tue, 3 Mar 2009 23:15:19 +0100 Subject: [PATCH] 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. --- src/list_window.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 { -- 2.30.2