aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-11-06 15:28:08 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-11-06 15:33:17 +0100
commiteb7288a1bf9e8627e4bc20241a41f21948f645eb (patch)
tree8b8d91aec644940b02b55182c7f027672e86a292 /vis.c
parentdd6cb7e5d7843cc10ca498f7d7bf4e26898b7d1a (diff)
downloadvis-eb7288a1bf9e8627e4bc20241a41f21948f645eb.tar.gz
vis-eb7288a1bf9e8627e4bc20241a41f21948f645eb.tar.xz
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 (limited to 'vis.c')
-rw-r--r--vis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index ae3dab5..d503405 100644
--- 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;