forked from aniani/vim
patch 8.2.2265: error message for missing endfunc/enddef is last line
Problem: Error message for missing endfunc/enddef is last line. Solution: Report the line where the function starts. (closes #7582)
This commit is contained in:
@@ -98,6 +98,24 @@ def Test_endfunc_enddef()
|
||||
CheckScriptFailure(lines, 'E1152:', 4)
|
||||
enddef
|
||||
|
||||
def Test_missing_endfunc_enddef()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
def Test()
|
||||
echo 'test'
|
||||
endef
|
||||
END
|
||||
CheckScriptFailure(lines, 'E1057:', 2)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
func Some()
|
||||
echo 'test'
|
||||
enfffunc
|
||||
END
|
||||
CheckScriptFailure(lines, 'E126:', 2)
|
||||
enddef
|
||||
|
||||
def ReturnString(): string
|
||||
return 'string'
|
||||
enddef
|
||||
|
||||
Reference in New Issue
Block a user