Merge pull request #1290 from Tyriar/1287_double_click_exception

Check for valid coords before getting word at coords
This commit is contained in:
Daniel Imms
2018-03-06 09:28:55 -08:00
committed by GitHub
+5
View File
@@ -634,6 +634,11 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
* @param coords The coordinates to get the word at.
*/
private _getWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean): IWordPosition {
// Ensure coords are within viewport (eg. not within scroll bar)
if (coords[0] >= this._terminal.cols) {
return null;
}
const bufferLine = this._buffer.lines.get(coords[1]);
if (!bufferLine) {
return null;