summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 152e021)
raw | patch | inline | side by side (parent: 152e021)
author | Jeffrey Middleton <jefromi@gmail.com> | |
Tue, 3 Mar 2009 22:15:19 +0000 (23:15 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 3 Mar 2009 22:15:19 +0000 (23:15 +0100) |
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.
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 | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index bf0f45aa18dd2019e6a634bf805859d31188570b..8d1a2d577b18fbe0753e36b6f804da599ed89a1f 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
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
{