aboutsummaryrefslogtreecommitdiff
path: root/vis-motions.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-04-14 11:15:17 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-04-14 11:15:17 +0200
commit63ebc9dad10e1f31058b7b4148c00198b67928de (patch)
treebe6b05a2db8461cf7acc1aabbbc926b7bcc07398 /vis-motions.c
parentc25e0c110430bd16056c6fe12e9e6676ebf1e5f5 (diff)
downloadvis-63ebc9dad10e1f31058b7b4148c00198b67928de.tar.gz
vis-63ebc9dad10e1f31058b7b4148c00198b67928de.tar.xz
vis: make certain operations interruptible with <C-c>
As currently implemented this will only work for operations which are individually fast, but repeated many times (e.g. `1000000itext<Escape>`).
Diffstat (limited to 'vis-motions.c')
-rw-r--r--vis-motions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vis-motions.c b/vis-motions.c
index 0166117..c3afe16 100644
--- a/vis-motions.c
+++ b/vis-motions.c
@@ -85,6 +85,8 @@ static size_t common_word_next(Vis *vis, Text *txt, size_t pos, enum VisMotion e
}
while (count--) {
+ if (vis->interrupted)
+ return pos;
size_t newpos = motion->txt(txt, pos);
if (newpos == pos)
break;