Mercurial > vim
diff src/ex_docmd.c @ 21487:5c92877092f9 v8.2.1294
patch 8.2.1294: Vim9: error when using vim9script in TextYankPost
Commit: https://github.com/vim/vim/commit/37394ff75270877a032422abcd079a6732a29730
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 25 19:38:18 2020 +0200
patch 8.2.1294: Vim9: error when using vim9script in TextYankPost
Problem: Vim9: error when using vim9script in TextYankPost.
Solution: Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
be used when text is locked. (closes #6529)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Jul 2020 19:45:05 +0200 |
parents | eec2d2120cde |
children | 7449921216bc |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2061,12 +2061,22 @@ do_one_cmd( goto doend; } - if (text_locked() && !(ea.argt & EX_CMDWIN) - && !IS_USER_CMDIDX(ea.cmdidx)) - { - // Command not allowed when editing the command line. - errormsg = _(get_text_locked_msg()); - goto doend; + if (!IS_USER_CMDIDX(ea.cmdidx)) + { +#ifdef FEAT_CMDWIN + if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN)) + { + // Command not allowed in the command line window + errormsg = _(e_cmdwin); + goto doend; + } +#endif + if (text_locked() && !(ea.argt & EX_LOCK_OK)) + { + // Command not allowed when text is locked + errormsg = _(get_text_locked_msg()); + goto doend; + } } // Disallow editing another buffer when "curbuf_lock" is set.