diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-10-12 07:40:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-12 07:40:50 -0400 |
| commit | 4bfbad6e91a2373b0d076f714878159c7005e62c (patch) | |
| tree | 40e2bde8ecbaa7534bfaf421fe4daa1ceb8bfdce /runtime/lua/vim/_ftplugin/lua.lua | |
| parent | 0f17fab61970cb453879a8f3cf7bc22c94e2e51a (diff) | |
| download | rneovim-4bfbad6e91a2373b0d076f714878159c7005e62c.tar.gz rneovim-4bfbad6e91a2373b0d076f714878159c7005e62c.tar.bz2 rneovim-4bfbad6e91a2373b0d076f714878159c7005e62c.zip | |
fix(multicursor): insert-mode Lua/API edit dropped on ESC #42312
Problem:
With multicursors, an Insert-mode edit by a Lua/`<Cmd>` mapping or API
(nvim_put(), …) is live-previewed at the other cursors, but dropped at
ESC: the cascade replays _redo_, which does not contain such edits.
Solution:
When `<Cmd>`/Lua/RPC changes the buffer during Insert-mode, sync the
previews and restart the capture (like a non-captured cursor-move). The
edit stays as text.
- The mapping runs only at the primary. Its text is mirrored as-is
(similar to insert-completion). Re-running it per cursor would require
a "partial-remap" span replay, and breaks single-session plugins
(vim.snippet).
- Not during completion; redo already captures the pre-inserted
candidate on accept.
- Text typed before the edit is kept as mirrored, not replayed, so
per-cursor effects ('textwidth' wrapping, …) don't apply to it.
Known issues:
- "o"/"O"/"cc" with 'autoindent' followed by the mapping: the per-cursor
insert-entry replay is still pending, so the edit is lost.
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions