dblClick test nodeName (#641)

This commit is contained in:
Philippe Potvin 2016-08-21 05:44:17 -04:00 committed by Leo Lamprecht
parent 7fbd8ccaf1
commit 3a9447185f

View file

@ -6,7 +6,12 @@ exports.clear = function (terminal) {
// Use selection extend upon dblclick
exports.extend = function (terminal) {
terminal.screen_.expandSelection(terminal.document_.getSelection());
let sel = terminal.document_.getSelection();
// Test if focusNode exist and nodeName is #text
if (sel.focusNode && sel.focusNode.nodeName === '#text') {
terminal.screen_.expandSelection(sel);
}
};
// Fix a bug in ScrollPort selectAll behavior