Mercurial > vim
changeset 23179:821701ecbde7 v8.2.2135
patch 8.2.2135: Vim9: #{ still seen as start of dict in some places
Commit: https://github.com/vim/vim/commit/93f82cbee515e13b564f51ddcd5e3d6694358ba4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 12 21:25:56 2020 +0100
patch 8.2.2135: Vim9: #{ still seen as start of dict in some places
Problem: Vim9: #{ still seen as start of dict in some places.
Solution: Remove check for { after #. (closes https://github.com/vim/vim/issues/7456)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Dec 2020 21:30:03 +0100 |
parents | 97d5bc8b35a4 |
children | 0966c0fbf3f5 |
files | src/ex_docmd.c src/testdir/test_vim9_script.vim src/version.c |
diffstat | 3 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1683,7 +1683,7 @@ comment_start(char_u *p, int starts_with { #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')
--- 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',