summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-12 21:25:56 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-12 21:25:56 +0100
commit93f82cbee515e13b564f51ddcd5e3d6694358ba4 (patch)
tree18f9ff8d170e80e3e90d2d6ef98817d9f243649f
parent57f799e6a4a56f41570c752c66dc2f692b1f2c2f (diff)
downloadvim-git-93f82cbee515e13b564f51ddcd5e3d6694358ba4.tar.gz
patch 8.2.2135: Vim9: #{ still seen as start of dict in some placesv8.2.2135
Problem: Vim9: #{ still seen as start of dict in some places. Solution: Remove check for { after #. (closes #7456)
-rw-r--r--src/ex_docmd.c3
-rw-r--r--src/testdir/test_vim9_script.vim14
-rw-r--r--src/version.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 065a03823..c80d23e10 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1683,7 +1683,7 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
{
#ifdef FEAT_EVAL
if (in_vim9script())
- return p[0] == '#' && p[1] != '{' && !starts_with_colon;
+ return p[0] == '#' && !starts_with_colon;
#endif
return *p == '"';
}
@@ -4780,7 +4780,6 @@ separate_nextcmd(exarg_T *eap)
|| (*p == '#'
&& in_vim9script()
&& !(eap->argt & EX_NOTRLCOM)
- && p[1] != '{'
&& p > eap->cmd && VIM_ISWHITE(p[-1]))
#endif
|| *p == '|' || *p == '\n')
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index bb070cacd..45103fcac 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -2069,7 +2069,21 @@ def Test_vim9_comment()
CheckScriptSuccess([
'vim9script',
'# something',
+ '#something',
+ '#{something',
])
+
+ split Xfile
+ CheckScriptSuccess([
+ 'vim9script',
+ 'edit #something',
+ ])
+ CheckScriptSuccess([
+ 'vim9script',
+ 'edit #{something',
+ ])
+ close
+
CheckScriptFailure([
'vim9script',
':# something',
diff --git a/src/version.c b/src/version.c
index f4211effa..7f78742ac 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2135,
+/**/
2134,
/**/
2133,