Have Terminal.hasSelection return false when no selection

Fixes #724
This commit is contained in:
Daniel Imms
2017-06-20 10:38:33 -07:00
parent 75b74ac4ff
commit 7b46940772
2 changed files with 22 additions and 1 deletions
+6 -1
View File
@@ -183,7 +183,12 @@ export class SelectionManager extends EventEmitter {
* Gets whether there is an active text selection.
*/
public get hasSelection(): boolean {
return !!this._model.finalSelectionStart && !!this._model.finalSelectionEnd;
const start = this._model.finalSelectionStart;
const end = this._model.finalSelectionEnd;
if (!start || !end) {
return false;
}
return start[0] !== end[0] || start[1] !== end[1];
}
/**