mirror of
https://github.com/neovim/neovim.git
synced 2026-09-08 15:07:49 +00:00
fix(multicursor): abandoned Visual selection does not move cursors #41670
Problem:
"v{motion}<Esc>" moves the primary cursor to the selection end, but the
other cursors snap back to their anchors unless follow-mode ("q=") is
on. The selection preview showed them at the selection end.
Solution:
Replay the abandoned selection at every cursor, not only in follow-mode.
An abandoned typed selection now always emits a "visual" CmdAtom.
This commit is contained in:
@@ -849,11 +849,15 @@ describe('CmdAtom', function()
|
||||
feed(',D')
|
||||
eq(before, #atoms())
|
||||
atom('w', 'dw', ',Dw') -- The supplied motion finishes the operation
|
||||
-- Same for a mapping that opens Visual mode: "<Esc>" abandons the selection and closes it.
|
||||
-- Same for a mapping that opens Visual mode: ESC closes the selection (cursor stays on the
|
||||
-- selection end, where it moved during the Visual sequence).
|
||||
feed(',V')
|
||||
eq(before + 1, #atoms())
|
||||
feed('<Esc>')
|
||||
eq({ type = 'mapping', lhs = k(',V<Esc>') }, pick(atom_last(), 'type', 'lhs', 'keys'))
|
||||
eq(
|
||||
{ type = 'visual', lhs = k(',V<Esc>'), keys = k('v<Esc>') },
|
||||
pick(atom_last(), 'type', 'lhs', 'keys')
|
||||
)
|
||||
-- A mapping whose trailing prefix is completed by TYPED keys ("," + "w")
|
||||
-- ends where its own keys stop: each `lhs` owns only what it produced.
|
||||
command('set notimeout')
|
||||
|
||||
Reference in New Issue
Block a user