Don't include trailing EOL when selecting multiple lines

Fixes #3552
This commit is contained in:
Daniel Imms
2021-12-21 10:49:58 -08:00
parent 9350a8b237
commit 8c94c97a28
2 changed files with 12 additions and 0 deletions
@@ -122,5 +122,13 @@ describe('SelectionModel', () => {
model.selectionEnd = [5, 2];
assert.deepEqual(model.finalSelectionEnd, [5, 2]);
});
it('should not include a trailing EOL when the selection ends at the end of a line', () => {
model.selectionStart = [0, 0];
model.selectionStartLength = 80;
assert.deepEqual(model.finalSelectionEnd, [80, 0]);
model.selectionStart = [0, 0];
model.selectionStartLength = 160;
assert.deepEqual(model.finalSelectionEnd, [80, 1]);
});
});
});