0
0
mirror of https://github.com/vim/vim.git synced 2025-10-29 09:37:35 -04:00

patch 8.2.4872: Vim9: no error for using an expression only

Problem:    Vim9: no error for using an expression only at the script level
            when followed by an empty line.
Solution:   Do not check the line number but whether something follows.
            (closes #10357)
This commit is contained in:
Bram Moolenaar
2022-05-05 16:08:55 +01:00
parent 09d9421b67
commit ea72038d60
3 changed files with 23 additions and 1 deletions

View File

@@ -650,6 +650,20 @@ def Test_use_register()
END
v9.CheckDefAndScriptFailure(lines, 'E1207:', 2)
lines =<< trim END
@a = 'echo "text"'
@a
END
v9.CheckDefAndScriptFailure(lines, 'E1207:', 2)
lines =<< trim END
@a = 'echo "text"'
@a
# comment
END
v9.CheckDefAndScriptFailure(lines, 'E1207:', 2)
lines =<< trim END
@/ = 'pattern'
@/