diff src/testdir/test_const.vim @ 18713:baf890fa1621 v8.1.2348

patch 8.1.2348: :const cannot be followed by "| endif" Commit: https://github.com/vim/vim/commit/8f76e6b12b958f2779444a92234bbaf3f49eeb99 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 26 16:50:30 2019 +0100 patch 8.1.2348: :const cannot be followed by "| endif" Problem: :const cannot be followed by "| endif". Solution: Check following command for :const. (closes https://github.com/vim/vim/issues/5269) Also fix completion after :const.
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 Nov 2019 17:00:04 +0100
parents 9606c0adc148
children bd4c34db84ab
line wrap: on
line diff
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -197,6 +197,12 @@ func Test_cannot_modify_existing_variabl
     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:')