提交 796f4d7b 编写于 作者: D Daniel Imms

Improve some comments, fix merge

上级 0631b650
...@@ -332,18 +332,15 @@ export class TerminalInstance implements ITerminalInstance { ...@@ -332,18 +332,15 @@ export class TerminalInstance implements ITerminalInstance {
return undefined; return undefined;
}); });
this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'mousedown', (event: KeyboardEvent) => { this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'mousedown', (event: KeyboardEvent) => {
// We need to listen to the mouseup event up to the document since the user may release the mouse button anywhere // We need to listen to the mouseup event on the document since the user may release
// outside of _xterm.element. // the mouse button anywhere outside of _xterm.element.
const listener = dom.addDisposableListener(document, 'mouseup', (event: KeyboardEvent) => { const listener = dom.addDisposableListener(document, 'mouseup', (event: KeyboardEvent) => {
// Delay with a setTimeout to allow the mouseup to propagate through the DOM
// before evaluating the new selection state.
setTimeout(() => this._refreshSelectionContextKey(), 0); setTimeout(() => this._refreshSelectionContextKey(), 0);
listener.dispose(); listener.dispose();
}); });
})); }));
this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'mouseup', (event: KeyboardEvent) => {
// Wait until mouseup has propagated through the DOM before
// evaluating the new selection state.
setTimeout(() => this._refreshSelectionContextKey(), 0);
}));
// xterm.js currently drops selection on keyup as we need to handle this case. // xterm.js currently drops selection on keyup as we need to handle this case.
this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => { this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册