From 5628a44fded9c8fd2288a357f8fdc6605eec27ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 27 Feb 2017 13:12:13 +0100 Subject: 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 --- view.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3