Support double click select word over wrapped lines

Part of #1571
This commit is contained in:
Daniel Imms
2018-07-26 11:09:29 -07:00
parent 8f22d8dda4
commit 7b68cb9fe7
2 changed files with 43 additions and 6 deletions
+6 -2
View File
@@ -77,8 +77,12 @@ export class SelectionModel {
}
// Use the selection start if the end doesn't exist or they're reversed
if (!this.selectionEnd || this.areSelectionValuesReversed()) {
return [this.selectionStart[0] + this.selectionStartLength, this.selectionStart[1]];
if (!this.selectionEnd) {
const startPlusLength = this.selectionStart[0] + this.selectionStartLength;
if (startPlusLength > this._terminal.cols) {
return [startPlusLength % this._terminal.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._terminal.cols)];
}
return [startPlusLength, this.selectionStart[1]];
}
// Ensure the the word/line is selected after a double/triple click