diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-08-16 16:17:31 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-01-23 22:35:05 +0100 |
commit | 43b395ec2e7d24a067d7cb00109818b64da144a5 (patch) | |
tree | fd8dfe4d22990fb00eab5d341ff2eaf1987b4c76 /src/errors.h | |
parent | 988f74311c26ea9917e84fbae608de226dba7e5f (diff) |
patch 9.1.0048: Abort opening cmdwin if autocmds screw things upv9.1.0048
Problem: Autocmds triggered from opening the cmdwin (in win_split and
do_ecmd) can cause issues such as E199, as the current checks
are insufficient.
Solution: Commands executed from the cmdwin apply to the old curwin/buf,
so they should be kept in a "suspended" state; abort if
they've changed. Also abort if cmdwin/buf was tampered with,
and check that curwin is correct. Try to clean up the cmdwin
buffer (only if hidden and non-current to simplify things; the
same approach is used when closing cmdwin normally), and add a
beep. (Sean Dewar)
It'd be nice to also check that curwin was *really* created by win_split, as
autocommands can change curwin before it returns (so it can't be assumed to be
that of the split); for now, this means that the cmdwin may not be the botwin in
that case, which is probably OK.
closes: #12819
Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/errors.h')
-rw-r--r-- | src/errors.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/errors.h b/src/errors.h index bfa49292cf..351ced9889 100644 --- a/src/errors.h +++ b/src/errors.h @@ -471,8 +471,8 @@ EXTERN char e_no_digraphs_version[] EXTERN char e_cannot_set_language_to_str[] INIT(= N_("E197: Cannot set language to \"%s\"")); // E198 unused -EXTERN char e_active_window_or_buffer_deleted[] - INIT(= N_("E199: Active window or buffer deleted")); +EXTERN char e_active_window_or_buffer_changed_or_deleted[] + INIT(= N_("E199: Active window or buffer changed or deleted")); EXTERN char e_readpre_autocommands_made_file_unreadable[] INIT(= N_("E200: *ReadPre autocommands made the file unreadable")); EXTERN char e_readpre_autocommands_must_not_change_current_buffer[] |