Fix select to word upwards

This commit is contained in:
Daniel Imms
2018-07-26 11:30:49 -07:00
parent 6a9da97163
commit 48f1c4667a
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -856,13 +856,16 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
endRow--;
}
// Adjust wrapped length value
while (wordPosition.start + wordPosition.length > this._terminal.cols) {
wordPosition.length -= this._terminal.cols;
endRow++;
// Adjust wrapped length value, this only needs to happen when values are reversed as in that
// case we're interested in the start of the word, not the end
if (!this._model.areSelectionValuesReversed()) {
while (wordPosition.start + wordPosition.length > this._terminal.cols) {
wordPosition.length -= this._terminal.cols;
endRow++;
}
}
this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? wordPosition.start : (wordPosition.start + wordPosition.length), endRow];
this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? wordPosition.start : wordPosition.start + wordPosition.length, endRow];
}
}