mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
fix(help): fix CTRL character issue for :help {subject} #39537
Problem: The argument to `:help` is normalized to fit the general tag format. I.e. i^U-default, iCTRL-U-default and i_CTRL_U-default should all point to the i_CTRL_U-default tag. Our normalization adds an underscore around the CTRL keycode, e.g. iCTRL-GCTRL-J becomes i_CTRL-G_CTRL-J. That's not necessary if the following part starts with a dash, like the case of iCTRL-U-default. Solution: Do not insert an underscore if the following character is a dash/minus (-).
This commit is contained in:
committed by
GitHub
parent
858cd3d106
commit
84ae70c172
@@ -108,7 +108,7 @@ function M.escape_subject(word)
|
||||
-- E.g. 'iCTRL-GCTRL-J' --> 'i_CTRL-G_CTRL-J'
|
||||
-- Only exception: 'CTRL-{character}'
|
||||
word = word:gsub('([^_])CTRL%-', '%1_CTRL-')
|
||||
word = word:gsub('(CTRL%-[^{])([^_\\])', '%1_%2')
|
||||
word = word:gsub('(CTRL%-[^{])([^-_\\])', '%1_%2')
|
||||
|
||||
-- Skip function arguments
|
||||
-- E.g. 'abs({expr})' --> 'abs'
|
||||
|
||||
Reference in New Issue
Block a user