summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-25 19:38:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-25 19:38:18 +0200
commit37394ff75270877a032422abcd079a6732a29730 (patch)
tree5a698cdeb43694788da3154f5c6e9a697fe059e8 /src/ex_docmd.c
parent2d6b20d6a9a034b39f79a7dbb889fb5d859583ae (diff)
patch 8.2.1294: Vim9: error when using vim9script in TextYankPostv8.2.1294
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)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 5459cfd7b8..04c3b465a7 100644
--- 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))
+ if (!IS_USER_CMDIDX(ea.cmdidx))
{
- // Command not allowed when editing the command line.
- errormsg = _(get_text_locked_msg());
- goto doend;
+#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.