mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.1.2349: :lockvar and :unlockvar cannot be followed by "| endif"
Problem: :lockvar and :unlockvar cannot be followed by "| endif". Solution: Check for following commands. (closes #5269)
This commit is contained in:
@@ -2384,6 +2384,7 @@ do_one_cmd(
|
|||||||
case CMD_leftabove:
|
case CMD_leftabove:
|
||||||
case CMD_let:
|
case CMD_let:
|
||||||
case CMD_lockmarks:
|
case CMD_lockmarks:
|
||||||
|
case CMD_lockvar:
|
||||||
case CMD_lua:
|
case CMD_lua:
|
||||||
case CMD_match:
|
case CMD_match:
|
||||||
case CMD_mzscheme:
|
case CMD_mzscheme:
|
||||||
@@ -2408,6 +2409,7 @@ do_one_cmd(
|
|||||||
case CMD_tilde:
|
case CMD_tilde:
|
||||||
case CMD_topleft:
|
case CMD_topleft:
|
||||||
case CMD_unlet:
|
case CMD_unlet:
|
||||||
|
case CMD_unlockvar:
|
||||||
case CMD_verbose:
|
case CMD_verbose:
|
||||||
case CMD_vertical:
|
case CMD_vertical:
|
||||||
case CMD_wincmd:
|
case CMD_wincmd:
|
||||||
|
@@ -203,6 +203,20 @@ func Test_const_with_condition()
|
|||||||
call assert_equal(0, x)
|
call assert_equal(0, x)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_lockvar()
|
||||||
|
let x = 'hello'
|
||||||
|
lockvar x
|
||||||
|
call assert_fails('let x = "there"', 'E741')
|
||||||
|
if 0 | unlockvar x | endif
|
||||||
|
call assert_fails('let x = "there"', 'E741')
|
||||||
|
unlockvar x
|
||||||
|
let x = 'there'
|
||||||
|
|
||||||
|
if 0 | lockvar x | endif
|
||||||
|
let x = 'again'
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
func Test_const_with_index_access()
|
func Test_const_with_index_access()
|
||||||
let l = [1, 2, 3]
|
let l = [1, 2, 3]
|
||||||
call assert_fails('const l[0] = 4', 'E996:')
|
call assert_fails('const l[0] = 4', 'E996:')
|
||||||
|
@@ -737,6 +737,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2349,
|
||||||
/**/
|
/**/
|
||||||
2348,
|
2348,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user