Merge pull request #950 from rebornix/Fix921

fix #921
This commit is contained in:
Peng Lyu 2016-10-19 14:52:04 -07:00 committed by GitHub
commit 08dd7c16d6
2 changed files with 11 additions and 0 deletions

View File

@ -2427,6 +2427,10 @@ class CommandDeleteToLineEnd extends BaseCommand {
canBeRepeatedWithDot = true;
public async exec(position: Position, vimState: VimState): Promise<VimState> {
if (position.isLineEnd()) {
return vimState;
}
return await new DeleteOperator().run(vimState, position, position.getLineEnd().getLeft());
}
}

View File

@ -105,6 +105,13 @@ suite("Mode Normal", () => {
end: ['t|e'],
});
newTest({
title: "Can handle 'D' on empty lines",
start: ['text', '|', 'text'],
keysPressed: 'D',
end: ['text', '|', 'text']
});
newTest({
title: "Can handle 'DD'",
start: ['tex|t'],