aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-27 13:12:13 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-27 14:28:06 +0100
commit5628a44fded9c8fd2288a357f8fdc6605eec27ee (patch)
treea2dfabf922913661e44156f9d0edf62f6a78de95
parent661dbb2c9eb4249d1083b838c432e183a8c633c3 (diff)
downloadvis-5628a44fded9c8fd2288a357f8fdc6605eec27ee.tar.gz
vis-5628a44fded9c8fd2288a357f8fdc6605eec27ee.tar.xz
view: reposition cursor after restoring selection
This should fix selection changes after shift operators in visual mode. The problem was that the NOP motion which is executed when switching back into visual-line mode destroys the selection if the cursor is not already placed on a selection boundary. Fix #501
-rw-r--r--view.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/view.c b/view.c
index db9a8a6..7dcc806 100644
--- a/view.c
+++ b/view.c
@@ -1265,6 +1265,7 @@ void view_cursors_selection_restore(Cursor *c) {
);
if (!text_range_valid(&sel))
return;
+ view_cursors_to(c, sel.end);
sel.end = text_char_next(txt, sel.end);
if (!(c->sel = view_selections_new(c->view, c)))
return;