diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-26 20:05:52 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-26 20:38:59 -0500 |
commit | f196ab87a1b5a9da1326d4de883ab7e97a0bb1f0 (patch) | |
tree | 3fb278570c31bc6e70a7f1d51efae3135f0e1024 /src/nvim/testdir | |
parent | d697690e24ae5ea9dc5189de504b03823f7fb0f4 (diff) | |
download | rneovim-f196ab87a1b5a9da1326d4de883ab7e97a0bb1f0.tar.gz rneovim-f196ab87a1b5a9da1326d4de883ab7e97a0bb1f0.tar.bz2 rneovim-f196ab87a1b5a9da1326d4de883ab7e97a0bb1f0.zip |
vim-patch:8.1.2348: :const cannot be followed by "| endif"
Problem: :const cannot be followed by "| endif".
Solution: Check following command for :const. (closes vim/vim#5269)
Also fix completion after :const.
https://github.com/vim/vim/commit/8f76e6b12b958f2779444a92234bbaf3f49eeb99
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_const.vim | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_let.vim | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 635ee7984a..23784b0308 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -159,6 +159,7 @@ func Test_expr_completion() endif for cmd in [ \ 'let a = ', + \ 'const a = ', \ 'if', \ 'elseif', \ 'while', diff --git a/src/nvim/testdir/test_const.vim b/src/nvim/testdir/test_const.vim index 06062c5e58..1d7b0a56b5 100644 --- a/src/nvim/testdir/test_const.vim +++ b/src/nvim/testdir/test_const.vim @@ -176,6 +176,12 @@ func Test_cannot_modify_existing_variable() call assert_fails('const [i2, f2, s2] = [1, 1.1, "vim"]', 'E995:') endfunc +func Test_const_with_condition() + const x = 0 + if 0 | const x = 1 | endif + call assert_equal(0, x) +endfunc + func Test_const_with_index_access() let l = [1, 2, 3] call assert_fails('const l[0] = 4', 'E996:') diff --git a/src/nvim/testdir/test_let.vim b/src/nvim/testdir/test_let.vim index 3c0fefbd25..0b9331ee38 100644 --- a/src/nvim/testdir/test_let.vim +++ b/src/nvim/testdir/test_let.vim @@ -24,6 +24,10 @@ func Test_let() let out = execute('let a {0 == 1 ? "a" : "b"}') let s = "\na #1\nb #2" call assert_equal(s, out) + + let x = 0 + if 0 | let x = 1 | endif + call assert_equal(0, x) endfunc func s:set_arg1(a) abort |