aboutsummaryrefslogtreecommitdiff
path: root/sam.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-26 20:40:05 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-26 21:48:52 +0100
commitcdd8c4b9a1544b64f2176df64dd7e24a2e08b74a (patch)
treef75685ce33cfc33870a8372ed2861852e1a12b89 /sam.h
parentb58b76bca867ee2a845c695faa3f1a5853cffc60 (diff)
downloadvis-cdd8c4b9a1544b64f2176df64dd7e24a2e08b74a.tar.gz
vis-cdd8c4b9a1544b64f2176df64dd7e24a2e08b74a.tar.xz
sam: disallow destructive commands in groups and looping constructs
This should fix segfaults for commands like `:{ q i/foo/ }` or `:x/pattern/ q` where a command invalidates the current window. The checks are a bit too strict, for example a destructive command at the end of a non-nested group would be fine, but is currently also rejected.
Diffstat (limited to 'sam.h')
-rw-r--r--sam.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sam.h b/sam.h
index 0ea9c2f..e94b175 100644
--- a/sam.h
+++ b/sam.h
@@ -18,6 +18,8 @@ enum SamError {
SAM_ERR_MARK,
SAM_ERR_CONFLICT,
SAM_ERR_WRITE_CONFLICT,
+ SAM_ERR_LOOP_INVALID_CMD,
+ SAM_ERR_GROUP_INVALID_CMD,
};
bool sam_init(Vis*);