OK-case: from insert-mode: place cursor at first atom, then cmd-d twice.
Result: atom and atom are selected.
NG-case: from normal-mode: place cursor at first atom, then cmd-d twice.
Result: atom and "atom(ic) are selected.
Detail
When executing from normal-mode, it no longer respect word-boundary matching.
Why this happens is vmp auto activate visual-mode on first cmd-d create selection.
At that timing, vmp clear important information which is used by cmd-d(find-and-replace:select-next)
find-and-replace's SelectNext instance hold this.wordSelected state, but it's cleared by lastSelection.onDidChangeRange which is exactly kicking when starting visual-mode.
Related #873
cc @chenglou
Reproduce
text
insert-mode
: place cursor at firstatom
, thencmd-d
twice.atom
andatom
are selected.normal-mode
: place cursor at firstatom
, thencmd-d
twice.atom
and "atom(ic)
are selected.Detail
normal-mode
, it no longer respect word-boundary matching.visual-mode
on firstcmd-d
create selection.cmd-d
(find-and-replace:select-next
)SelectNext
instance holdthis.wordSelected
state, but it's cleared bylastSelection.onDidChangeRange
which is exactly kicking when startingvisual-mode
.