Skip to content

Commit

Permalink
Fix #397. (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix authored and jpoon committed Jul 8, 2016
1 parent ded53ff commit 5587de0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,10 @@ export class ModeHandler implements vscode.Disposable {
let recordedState = vimState.recordedState;

if (recordedState.operator) {
if (start.compareTo(stop) > 0) {
[start, stop] = [stop, start];
}

if (vimState.currentMode !== ModeName.Visual &&
vimState.currentMode !== ModeName.VisualLine &&
vimState.currentRegisterMode !== RegisterMode.LineWise) {
Expand All @@ -746,10 +750,6 @@ export class ModeHandler implements vscode.Disposable {
}
}

if (start.compareTo(stop) > 0) {
[start, stop] = [stop, start];
}

if (this.currentModeName === ModeName.VisualLine) {
start = start.getLineBegin();
stop = stop.getLineEnd();
Expand Down
8 changes: 4 additions & 4 deletions test/mode/modeNormal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ suite("Mode Normal", () => {

newTest({
title: "Can handle 'db'",
start: ['text tex|t'],
start: ['One tw|o'],
keysPressed: '$db',
end: ['text |t'],
end: ['One |o'],
});

newTest({
title: "Can handle 'db then 'db' again",
start: ['text tex|t'],
start: ['One tw|o'],
keysPressed: '$dbdb',
end: ['|t'],
end: ['|o'],
});

newTest({
Expand Down

0 comments on commit 5587de0

Please sign in to comment.