vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 1152f53f8d9e342675bc4d84ace81da763c42bc4
parent 37cb7af023485c26be750945cd1253afa0d7d4ec
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri,  6 Nov 2015 15:28:08 +0100

vis: fix cursor position after charwise paste

p and P should leave the cursor on the last inserted character
to ease repetition.

Closes #92

Diffstat:
Mvis.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/vis.c b/vis.c @@ -1179,6 +1179,13 @@ static size_t op_put(Vis *vis, Text *txt, OperatorContext *c) { pos = text_line_start(txt, c->pos); break; } + } else { + switch (c->arg->i) { + case OP_PUT_AFTER: + case OP_PUT_BEFORE: + pos = text_char_prev(txt, pos); + break; + } } return pos;