forked from aniani/vim
patch 8.2.1746: Vim9: cannot use "fina" for "finally"
Problem: Vim9: Cannot use "fina" for "finally". (Naruhiko Nishino) Solution: Specifically check for "fina". (closes #7020)
This commit is contained in:
parent
d47f50b331
commit
373863ed48
@ -3420,6 +3420,10 @@ find_ex_command(
|
||||
eap->cmdidx = CMD_SIZE;
|
||||
}
|
||||
|
||||
// ":fina" means ":finally" for backwards compatibility.
|
||||
if (eap->cmdidx == CMD_final && p - eap->cmd == 4)
|
||||
eap->cmdidx = CMD_finally;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ func T25_F()
|
||||
if loops == 2
|
||||
try
|
||||
Xpath 'f' . loops
|
||||
finally
|
||||
final
|
||||
Xpath 'g' . loops
|
||||
endtry
|
||||
endif
|
||||
@ -49,19 +49,20 @@ func T25_F()
|
||||
Xpath 'i'
|
||||
endfunc
|
||||
|
||||
" Also try using "fina" and "final" and "finall" as abbraviations.
|
||||
func T25_G()
|
||||
if 1
|
||||
try
|
||||
Xpath 'A'
|
||||
call T25_F()
|
||||
Xpath 'B'
|
||||
finally
|
||||
fina
|
||||
Xpath 'C'
|
||||
endtry
|
||||
else
|
||||
try
|
||||
Xpath 'D'
|
||||
finally
|
||||
finall
|
||||
Xpath 'E'
|
||||
endtry
|
||||
endif
|
||||
|
@ -316,7 +316,7 @@ def Test_try_catch()
|
||||
endtry
|
||||
catch /wrong/
|
||||
add(l, 'caught')
|
||||
finally
|
||||
fina
|
||||
add(l, 'finally')
|
||||
endtry
|
||||
assert_equal(['1', 'caught', 'finally'], l)
|
||||
@ -526,7 +526,7 @@ enddef
|
||||
def ReturnFinally(): string
|
||||
try
|
||||
return 'intry'
|
||||
finally
|
||||
finall
|
||||
g:in_finally = 'finally'
|
||||
endtry
|
||||
return 'end'
|
||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1746,
|
||||
/**/
|
||||
1745,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user