diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-04-04 08:14:03 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-04-04 08:14:03 +0200 |
| commit | dd730eb1feb46e9688350b0ff401694653f90554 (patch) | |
| tree | 659630ee90a50c81ed9d826bb944187b3ebf0c61 /vis.c | |
| parent | 2cfaf219558dd730478e4c5e27376091b617a50f (diff) | |
| download | vis-dd730eb1feb46e9688350b0ff401694653f90554.tar.gz vis-dd730eb1feb46e9688350b0ff401694653f90554.tar.xz | |
vis: automatically dispose invalid cursors
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -838,7 +838,14 @@ void vis_do(Vis *vis) { for (Cursor *cursor = view_cursors(view), *next; cursor; cursor = next) { next = view_cursors_next(cursor); + size_t pos = view_cursors_pos(cursor); + if (pos == EPOS) { + if (!view_cursors_dispose(cursor)) + view_cursors_to(cursor, 0); + continue; + } + Register *reg = multiple_cursors ? view_cursors_register(cursor) : a->reg; if (!reg) reg = &vis->registers[file->internal ? VIS_REG_PROMPT : VIS_REG_DEFAULT]; |
