mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
Fix dot repeat after exiting Visual modes or command line (#8090)
Fixes #7627
This commit is contained in:
parent
974ba70fa4
commit
63bb90947b
@ -797,6 +797,18 @@ export class ModeHandler implements vscode.Disposable, IModeHandler {
|
||||
(ranRepeatableAction && this.vimState.currentMode === Mode.Normal) ||
|
||||
this.createUndoPointForBrackets();
|
||||
|
||||
// We don't want to record a repeatable action when exiting from these modes
|
||||
// by pressing <Esc>
|
||||
if (
|
||||
(prevMode === Mode.Visual ||
|
||||
prevMode === Mode.VisualBlock ||
|
||||
prevMode === Mode.VisualLine ||
|
||||
prevMode === Mode.CommandlineInProgress) &&
|
||||
action.keysPressed[0] === '<Esc>'
|
||||
) {
|
||||
ranRepeatableAction = false;
|
||||
}
|
||||
|
||||
// Record down previous action and flush temporary state
|
||||
if (ranRepeatableAction && this.vimState.lastCommandDotRepeatable) {
|
||||
globalState.previousFullAction = this.vimState.recordedState;
|
||||
|
@ -218,6 +218,20 @@ suite('Repeat content change', () => {
|
||||
keysPressed: 'a<C-t>b<left>c<Esc>j.',
|
||||
end: ['\tonecb', 'tw|co'],
|
||||
});
|
||||
|
||||
newTest({
|
||||
title: 'Can repeat change after v<Esc> and :<Esc>',
|
||||
start: ['aaa bbb ccc dd|d'],
|
||||
keysPressed: 'ciwxxx<Esc>' + 'bb.' + 'bbv<Esc>.' + 'bb:<Esc>.',
|
||||
end: ['xx|x xxx xxx xxx'],
|
||||
});
|
||||
|
||||
newTest({
|
||||
title: 'Can repeat change after V<Esc> and <C-q><Esc>',
|
||||
start: ['aaa bbb ccc dd|d'],
|
||||
keysPressed: 'ciwxxx<Esc>' + 'bb.' + 'bbV<Esc>.' + 'bb<C-q><Esc>.',
|
||||
end: ['xx|x xxx xxx xxx'],
|
||||
});
|
||||
});
|
||||
|
||||
suite('Dot Operator repeat with remap', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user