Skip to content

Commit

Permalink
Fixes #1573
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed Apr 26, 2017
1 parent 2b5fafb commit 7c6b2f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,12 @@ export class CommandInsertInInsertMode extends BaseCommand {
range: new Range(new Position(position.line, desiredLineLength), new Position(position.line, line.length))
});
} else {
vimState.recordedState.transformations.push({
type: "deleteText",
position: position,
});
if (position.line !== 0 || position.character !== 0) {
vimState.recordedState.transformations.push({
type: "deleteText",
position: position,
});
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions test/mode/modeInsert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,21 @@ suite("Mode Insert", () => {
keysPressed: 'a<BS><Esc>',
end: ['abcd', " | "],
});

newTest({
title: "Backspace works on end of whitespace only lines",
start: ['abcd', ' | '],
keysPressed: 'a<BS><Esc>',
end: ['abcd', " | "],
});

newTest({
title: "Backspace works at beginning of file",
start: ['|bcd'],
keysPressed: 'i<BS>a<Esc>',
end: ['|abcd'],
});

newTest({
title: "Can perform <ctrl+o> to exit and perform one command in normal",
start: ['testtest|'],
Expand Down

0 comments on commit 7c6b2f2

Please sign in to comment.