mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 19:11:52 +00:00
vim-patch:partial:9.2.0573: Vim9: missing EX_WHOLE on some block keywords (#40071)
Problem: Several Vim9 keywords lack EX_WHOLE and can be shortened in
Vim9 script, inconsistent with endif/enddef/endfor/endwhile/
endtry which already have it. The error from :endd in a
nested function also hardcodes "enddef" instead of reporting
what the user typed. fullcommand("ho") returns "horizontal"
even though :ho is below the documented 3-char minimum.
Solution: Add EX_WHOLE to :class, :def, :endclass, :endinterface,
:endenum, :public and :static. In get_function_body() pass
the user-typed command to the error message. Force :ho to
CMD_SIZE in find_ex_command() so fullcommand() reflects the
modifier minimum. Extend tests and documentation accordingly
(Peter Kenny).
fixes: vim/vim#20032
closes: vim/vim#20191
38d9a16eba
Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
This commit is contained in:
12
runtime/lua/vim/_meta/vimfn.gen.lua
generated
12
runtime/lua/vim/_meta/vimfn.gen.lua
generated
@@ -2571,8 +2571,16 @@ function vim.fn.foreach(expr1, expr2) end
|
||||
--- Returns an empty string if a command doesn't exist or if it's
|
||||
--- ambiguous (for user-defined commands).
|
||||
---
|
||||
--- For example `fullcommand('s')`, `fullcommand('sub')`,
|
||||
--- `fullcommand(':%substitute')` all return "substitute".
|
||||
--- Note: Command validation is not performed. Results depend on
|
||||
--- Vim's internal command-specific identification rules.
|
||||
--- Examples:
|
||||
--- >vim
|
||||
--- echo [fullcommand('s')] |" ['substitute']
|
||||
--- echo [fullcommand('sub')] |" ['substitute']
|
||||
--- echo [fullcommand(': mark word')] |" ['mark']
|
||||
--- echo [fullcommand(': markword')] |" ['']
|
||||
--- echo [fullcommand('en')] |" ['endif']
|
||||
--- <
|
||||
---
|
||||
--- @param name string
|
||||
--- @return string
|
||||
|
||||
Reference in New Issue
Block a user