mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
vim-patch:9.1.0752: can set 'cedit' to an invalid value (#30616)
Problem: can set cedit to an invalid value
Solution: Check that the value is a valid key name
(Milly)
closes: vim/vim#15778
25732435c5
Co-authored-by: Milly <milly.ca@gmail.com>
This commit is contained in:
parent
d983599613
commit
2168d772b8
@ -1276,9 +1276,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
The key used in Command-line Mode to open the command-line window.
|
The key used in Command-line Mode to open the command-line window.
|
||||||
Only non-printable keys are allowed.
|
Only non-printable keys are allowed.
|
||||||
The key can be specified as a single character, but it is difficult to
|
The key can be specified as a single character, but it is difficult to
|
||||||
type. The preferred way is to use the <> notation. Examples: >vim
|
type. The preferred way is to use |key-notation| (e.g. <Up>, <C-F>) or
|
||||||
exe "set cedit=\<C-Y>"
|
a letter preceded with a caret (e.g. `^F` is CTRL-F). Examples: >vim
|
||||||
exe "set cedit=\<Esc>"
|
set cedit=^Y
|
||||||
|
set cedit=<Esc>
|
||||||
< |Nvi| also has this option, but it only uses the first character.
|
< |Nvi| also has this option, but it only uses the first character.
|
||||||
See |cmdwin|.
|
See |cmdwin|.
|
||||||
|
|
||||||
|
7
runtime/lua/vim/_meta/options.lua
generated
7
runtime/lua/vim/_meta/options.lua
generated
@ -731,11 +731,12 @@ vim.go.cd = vim.go.cdpath
|
|||||||
--- The key used in Command-line Mode to open the command-line window.
|
--- The key used in Command-line Mode to open the command-line window.
|
||||||
--- Only non-printable keys are allowed.
|
--- Only non-printable keys are allowed.
|
||||||
--- The key can be specified as a single character, but it is difficult to
|
--- The key can be specified as a single character, but it is difficult to
|
||||||
--- type. The preferred way is to use the <> notation. Examples:
|
--- type. The preferred way is to use `key-notation` (e.g. <Up>, <C-F>) or
|
||||||
|
--- a letter preceded with a caret (e.g. `^F` is CTRL-F). Examples:
|
||||||
---
|
---
|
||||||
--- ```vim
|
--- ```vim
|
||||||
--- exe "set cedit=\\<C-Y>"
|
--- set cedit=^Y
|
||||||
--- exe "set cedit=\\<Esc>"
|
--- set cedit=<Esc>
|
||||||
--- ```
|
--- ```
|
||||||
--- `Nvi` also has this option, but it only uses the first character.
|
--- `Nvi` also has this option, but it only uses the first character.
|
||||||
--- See `cmdwin`.
|
--- See `cmdwin`.
|
||||||
|
@ -4302,7 +4302,7 @@ const char *did_set_cedit(optset_T *args)
|
|||||||
cedit_key = -1;
|
cedit_key = -1;
|
||||||
} else {
|
} else {
|
||||||
int n = string_to_key(p_cedit);
|
int n = string_to_key(p_cedit);
|
||||||
if (vim_isprintc(n)) {
|
if (n == 0 || vim_isprintc(n)) {
|
||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
cedit_key = n;
|
cedit_key = n;
|
||||||
|
@ -996,9 +996,10 @@ return {
|
|||||||
The key used in Command-line Mode to open the command-line window.
|
The key used in Command-line Mode to open the command-line window.
|
||||||
Only non-printable keys are allowed.
|
Only non-printable keys are allowed.
|
||||||
The key can be specified as a single character, but it is difficult to
|
The key can be specified as a single character, but it is difficult to
|
||||||
type. The preferred way is to use the <> notation. Examples: >vim
|
type. The preferred way is to use |key-notation| (e.g. <Up>, <C-F>) or
|
||||||
exe "set cedit=\\<C-Y>"
|
a letter preceded with a caret (e.g. `^F` is CTRL-F). Examples: >vim
|
||||||
exe "set cedit=\\<Esc>"
|
set cedit=^Y
|
||||||
|
set cedit=<Esc>
|
||||||
< |Nvi| also has this option, but it only uses the first character.
|
< |Nvi| also has this option, but it only uses the first character.
|
||||||
See |cmdwin|.
|
See |cmdwin|.
|
||||||
]=],
|
]=],
|
||||||
|
Loading…
Reference in New Issue
Block a user