diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-04-14 11:15:17 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-04-14 11:15:17 +0200 |
| commit | 63ebc9dad10e1f31058b7b4148c00198b67928de (patch) | |
| tree | be6b05a2db8461cf7acc1aabbbc926b7bcc07398 /sam.c | |
| parent | c25e0c110430bd16056c6fe12e9e6676ebf1e5f5 (diff) | |
| download | vis-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 'sam.c')
| -rw-r--r-- | sam.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1657,7 +1657,7 @@ static bool cmd_filter(Vis *vis, Win *win, Command *cmd, const char *argv[], Cur int status = vis_pipe(vis, win->file, range, &argv[1], &bufout, read_buffer, &buferr, read_buffer); - if (vis->cancel_filter) { + if (vis->interrupted) { vis_info_show(vis, "Command cancelled"); } else if (status == 0) { size_t len = buffer_length(&bufout); @@ -1671,7 +1671,7 @@ static bool cmd_filter(Vis *vis, Win *win, Command *cmd, const char *argv[], Cur buffer_release(&bufout); buffer_release(&buferr); - return !vis->cancel_filter && status == 0; + return !vis->interrupted && status == 0; } static bool cmd_launch(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor *cur, Filerange *range) { @@ -1700,14 +1700,14 @@ static bool cmd_pipeout(Vis *vis, Win *win, Command *cmd, const char *argv[], Cu if (status == 0 && cur) view_cursors_to(cur, range->start); - if (vis->cancel_filter) + if (vis->interrupted) vis_info_show(vis, "Command cancelled"); else if (status != 0) vis_info_show(vis, "Command failed %s", buffer_content0(&buferr)); buffer_release(&buferr); - return !vis->cancel_filter && status == 0; + return !vis->interrupted && status == 0; } static bool cmd_cd(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor *cur, Filerange *range) { |
