diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-25 20:06:15 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-25 20:06:15 +0100 |
| commit | 2f498cab6e195ab9f5e2321cffe48894560c9c38 (patch) | |
| tree | c4f0c4b4abb02675fbd7d7fa5cbb5e6d5806e651 /vis.c | |
| parent | 046819649794ff1d2fb23480cad28cc036a0743c (diff) | |
| download | vis-2f498cab6e195ab9f5e2321cffe48894560c9c38.tar.gz vis-2f498cab6e195ab9f5e2321cffe48894560c9c38.tar.xz | |
vis: tweak handling of end inclusiveness
Only extend end of range when the motion did so too.
As an example this prevents motions like `$dg_` from deleting the newline
which was the starting position.
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -759,8 +759,9 @@ void vis_do(Vis *vis) { window_jumplist_add(win, pos); else window_jumplist_invalidate(win); - } else if (a->movement->type & INCLUSIVE || - (linewise && a->movement->type & LINEWISE_INCLUSIVE)) { + } else if (a->movement->type & INCLUSIVE && c.range.end > start) { + c.range.end = text_char_next(txt, c.range.end); + } else if (linewise && (a->movement->type & LINEWISE_INCLUSIVE)) { c.range.end = text_char_next(txt, c.range.end); } } else if (a->textobj) { |
