From a19159c506577a168655afcd961381dd1f995610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 28 Jul 2015 12:30:47 +0200 Subject: vis: do not move cursor in multicursor mode after undo/redo --- vis.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 0f4cc20..b10f798 100644 --- a/vis.c +++ b/vis.c @@ -985,7 +985,9 @@ static void mark_line(const Arg *arg) { static void undo(const Arg *arg) { size_t pos = text_undo(vis->win->file->text); if (pos != EPOS) { - view_cursor_to(vis->win->view, pos); + View *view = vis->win->view; + if (view_cursors_count(view) == 1) + view_cursor_to(view, pos); /* redraw all windows in case some display the same file */ editor_draw(vis); } @@ -994,7 +996,9 @@ static void undo(const Arg *arg) { static void redo(const Arg *arg) { size_t pos = text_redo(vis->win->file->text); if (pos != EPOS) { - view_cursor_to(vis->win->view, pos); + View *view = vis->win->view; + if (view_cursors_count(view) == 1) + view_cursor_to(view, pos); /* redraw all windows in case some display the same file */ editor_draw(vis); } -- cgit v1.2.3