patch 9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly

Problem:  'cedit', 'termwinkey' and 'wildchar' may not be parsed
          correctly
Solution: improve string_to_key() function in option.c
          (Milly)

- Problem: `^@` raises an error.
  Solution: Store as `<Nul>`.
- Problem: `<t_xx` does not raise an error.
  Solution: Raise an error if closing `>` is missing.
- Problem: Single `<` or `^` raises an error. It is inconvenient for users.
  Solution: They are stored as a single character.

closes: #15811

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Milly
2024-10-06 16:47:02 +02:00
committed by Christian Brabandt
parent 1a31c430bb
commit a9c6f90918
4 changed files with 35 additions and 14 deletions

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2024 Oct 02
*options.txt* For Vim version 9.1. Last change: 2024 Oct 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -8432,8 +8432,11 @@ A jump table for the options with a short description can be found at |Q_op|.
local to window
The key that starts a CTRL-W command in a terminal window. Other keys
are sent to the job running in the window.
The <> notation can be used, e.g.: >
:set termwinkey=<C-L>
The key can be specified as a single character, a |key-notation| (e.g.
<Up>, <C-F>) or a letter preceded with a caret (e.g. `^F` is CTRL-F): >
:set twk=X
:set twk=^I
:set twk=<C-L>
< The string must be one key stroke but can be multiple bytes.
When not set CTRL-W is used, so that CTRL-W : gets you to the command
line. If 'termwinkey' is set to CTRL-L then CTRL-L : gets you to the
@ -9330,7 +9333,12 @@ A jump table for the options with a short description can be found at |Q_op|.
Some keys will not work, such as CTRL-C, <CR> and Enter.
<Esc> can be used, but hitting it twice in a row will still exit
command-line as a failsafe measure.
Although 'wc' is a number option, you can set it to a special key: >
Although 'wc' is a number option, it can be specified as a number, a
single character, a |key-notation| (e.g. <Up>, <C-F>) or a letter
preceded with a caret (e.g. `^F` is CTRL-F): >
:set wc=27
:set wc=X
:set wc=^I
:set wc=<Tab>
< NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.