aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vis.c b/vis.c
index 03dcc61..3398c6c 100644
--- a/vis.c
+++ b/vis.c
@@ -645,10 +645,10 @@ static void action_do(Vis *vis, Action *a) {
if (a->op) {
size_t pos = a->op->func(vis, txt, &c);
- if (pos != EPOS) {
- view_cursors_to(cursor, pos);
- } else {
+ if (pos == EPOS) {
view_cursors_dispose(cursor);
+ } else if (pos <= text_size(txt)) {
+ view_cursors_to(cursor, pos);
}
}
}