diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 12:30:47 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-07-28 13:21:50 +0200 |
| commit | a19159c506577a168655afcd961381dd1f995610 (patch) | |
| tree | e47329a2f5af3fa14d9fffa1461698ae16d04116 | |
| parent | 3cc2390fed1cb4a626100e4bec428575a3e95f1a (diff) | |
| download | vis-a19159c506577a168655afcd961381dd1f995610.tar.gz vis-a19159c506577a168655afcd961381dd1f995610.tar.xz | |
vis: do not move cursor in multicursor mode after undo/redo
| -rw-r--r-- | vis.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); } |
