forked from aniani/vim
patch 9.1.0985: Vim9: some ex commands can be shortened
Problem: Vim9: some ex commands can be shortened
Solution: disallow shortening of :abstract, :interface and :type
(h-east)
closes: #16356
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
663d18d610
commit
aa979c763d
@@ -2386,6 +2386,22 @@ def Test_interface_basics()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1345: Not a valid command in an interface: return 5', 6)
|
||||
|
||||
# Test for "interface" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
inte Something
|
||||
endinterface
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: inte Something', 2)
|
||||
|
||||
# Test for "endinterface" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
interface Something
|
||||
endin
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: endin', 3)
|
||||
|
||||
# Additional commands after "interface name"
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
@@ -3525,6 +3541,14 @@ def Test_abstract_class()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1316: Class can only be defined in Vim9 script', 1)
|
||||
|
||||
# Test for "abstract" cannot be abbreviated
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
abs class A
|
||||
endclass
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1065: Command cannot be shortened: abs class A', 2)
|
||||
|
||||
# Additional commands after "abstract class"
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
||||
Reference in New Issue
Block a user