Mercurial > vim
view src/proto/syntax.pro @ 34196:57b21d421cb2 v9.1.0048
patch 9.1.0048: Abort opening cmdwin if autocmds screw things up
Commit: https://github.com/vim/vim/commit/43b395ec2e7d24a067d7cb00109818b64da144a5
Author: Sean Dewar <seandewar@users.noreply.github.com>
Date: Wed Aug 16 16:17:31 2023 +0100
patch 9.1.0048: Abort opening cmdwin if autocmds screw things up
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 23 Jan 2024 23:00:05 +0100 |
parents | fbeebe308514 |
children |
line wrap: on
line source
/* syntax.c */ void syntax_start(win_T *wp, linenr_T lnum); void syn_stack_free_all(synblock_T *block); void syn_stack_apply_changes(buf_T *buf); void syntax_end_parsing(win_T *wp, linenr_T lnum); int syntax_check_changed(linenr_T lnum); int get_syntax_attr(colnr_T col, int *can_spell, int keep_state); void syntax_clear(synblock_T *block); void reset_synblock(win_T *wp); void ex_syntax(exarg_T *eap); void ex_ownsyntax(exarg_T *eap); int syntax_present(win_T *win); void reset_expand_highlight(void); void set_context_in_echohl_cmd(expand_T *xp, char_u *arg); void set_context_in_syntax_cmd(expand_T *xp, char_u *arg); char_u *get_syntax_name(expand_T *xp, int idx); int syn_get_id(win_T *wp, long lnum, colnr_T col, int trans, int *spellp, int keep_state); int get_syntax_info(int *seqnrp); int syn_get_sub_char(void); int syn_get_stack_item(int i); int syn_get_foldlevel(win_T *wp, long lnum); void ex_syntime(exarg_T *eap); char_u *get_syntime_arg(expand_T *xp, int idx); /* vim: set ft=c : */