mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 00:51:53 +00:00
fix(cmdatom): <Cmd> mappings #41347
Problem:
`<cmd>` mappings do not emit `CmdAtom.text`.
`<cmd>` and Lua-callback mappings that edit the buffer apply only at the
primary cursor, not cascaded (multicursor).
Solution:
Capture the `<cmd>` command in getcmdkeycmd().
Add kKeyOpaque ("no capturable keys"); narrow kKeySynthetic ("not
a keystroke") to K_EVENT/K_IGNORE, so an opaque mapping's edit still
sets `map_edit` and cascades via LHS-replay.
This commit is contained in:
@@ -471,7 +471,7 @@ CmdAtom After a user action (an input "atom"): any
|
||||
|nvim_feedkeys()| (mode "n") to replay. Use
|
||||
|keytrans()| to key-notation. Empty for
|
||||
a mapping whose commands have no replayable
|
||||
keys (|<Cmd>|/Lua commands).
|
||||
keys (Lua callbacks).
|
||||
- lhs: LHS (user input). Raw bytes, like `keys`.
|
||||
- motionforce |forced-motion|: "v", "V", or
|
||||
"<C-V>" (|key-notation|).
|
||||
@@ -486,6 +486,7 @@ CmdAtom After a user action (an input "atom"): any
|
||||
Literal text, not key encoding. Examples:
|
||||
- typed "iab<Esc>" → text="ab"
|
||||
- typed ":cnext<CR>" → text="cnext"
|
||||
- typed "<Cmd>cnext<CR>" → text="cnext"
|
||||
- typed "iab<Left>c<Esc>" → text="c"
|
||||
- type: "command", "ex", "insert", "jump",
|
||||
"mapping", "motion", "mouse", "operator",
|
||||
|
||||
Reference in New Issue
Block a user