Closed kentor closed 4 years ago
If you can reproduce it, give me complete set of
this is with clearMultipleCursorsOnEscapeInsertMode: true
sample text:
aaaa bbbb
aaaa bbbb
put cursor on top row b
(any one, they all behave the same)
keystrokes:
cmd+d
cmd+d
c
cccc
escape
final text:
aaaa cccc
aaaa cccc
cursor will be on last c of last row expect cursor to be on last c of first row
cursor will be on last c of last row expect cursor to be on last c of first row
Cursor should be at 2nd(=last row) c, this is designed behavior.
Last cursor is the cursor added most recently(thus, 2nd row in this case), see where autocomplete-plus's popup shows up.(It would be shows up at 2nd bbb
position in this case).
So IMO, you have wrong expectation what last cursor is.
hmm interesting that the autocomplete-plus shows up on the 2nd cursor
but i would still expect the cursor to go back to where you originally started the multiple cursors with cmd+d, and i have two cases for why:
if you turn off vim-mode-plus, and repeat the same thing with
cmd+d
cmd+d
cccc
escape
the cursor will be on the first row.
this is also the behavior that i am used to on sublime text's vim mode + multiple cursors and vscode's vscodevim + multiple cursors
For specific scenario you explained above, I understand your request.
But that behavior is based on behavior Atom-core not respect last-cursor position when merging multiple-cursor(or selections). I intentionally avoid using that atom-core's behavior, it might be good in some scenario(like you explained), but bad for many other scenarios.
I can add this as opt-in-by-config feature(not so motivated though for me). Will keep open for a while to collect feedback from others.
My expectations align with @kentor. With clearMultipleCursorsOnEscapeInsertMode
enabled I'd expect the first added cursor's position to be respected.
In terms of tests found in vim-state-spec.coffee
this is the expected behaviour.
describe "clearMultipleCursorsOnEscapeInsertMode setting", ->
beforeEach ->
set
text: 'abc'
cursor: [[0, 1], [0, 2]]
describe "when enabled, clear multiple cursors on escaping insert-mode", ->
beforeEach ->
settings.set('clearMultipleCursorsOnEscapeInsertMode', true)
it "clear multiple cursors by respecting first added cursor's position", ->
ensure 'escape', mode: 'normal', numCursors: 1, cursor: [0, 0]
it "clear multiple cursors by respecting first added cursor's position", ->
set cursor: [[0, 2], [0, 1]]
ensure 'escape', mode: 'normal', numCursors: 1, cursor: [0, 1]
By the way, I should add this (reversed) behaviour aligns with default Atom when adding cursors with cmd+d
, making changes and finally clearing cursors with esc
. Currently my workaround is to clear multiple cursors while in insert mode.
Check list
atom --version
)Saw this https://github.com/t9md/atom-vim-mode-plus/issues/562 but seems to not work. Check out the gif: