Add hasSelection public API

This commit is contained in:
Daniel Imms
2017-06-07 12:40:48 -07:00
parent 9e47ec9af2
commit 1343b83fc3
2 changed files with 15 additions and 1 deletions
+7
View File
@@ -145,6 +145,13 @@ export class SelectionManager extends EventEmitter {
this._buffer = buffer;
}
/**
* Gets whether there is an active text selection.
*/
public get hasSelection(): boolean {
return !!this._model.finalSelectionStart && !!this._model.finalSelectionEnd;
}
/**
* Gets the text currently selected.
*/