diff --git a/src/actions/actions.ts b/src/actions/actions.ts index a5972e6beec..0d88b0296ef 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -871,7 +871,7 @@ export class DeleteOperator extends BaseOperator { resultingPosition = Position.EarlierOf(start, end); } - if (start.character >= TextEditor.getLineAt(start).text.length) { + if (start.character > TextEditor.getLineAt(start).text.length) { resultingPosition = start.getLeft(); } else { resultingPosition = start; diff --git a/test/mode/modeNormal.test.ts b/test/mode/modeNormal.test.ts index 10024b59e36..25a73818967 100644 --- a/test/mode/modeNormal.test.ts +++ b/test/mode/modeNormal.test.ts @@ -1072,6 +1072,13 @@ suite("Mode Normal", () => { end: ["abc abc |dhi"] }); + newTest({ + title: "can handle p in visual to end of line", + start: ["1234 |5678", "test test"], + keysPressed: "vllllyjvllllp", + end: ["1234 5678", "test |5678", ""] + }); + newTest({ title: "can repeat backspace twice", start: ["|11223344"],