Merge branch 'master' into parser_hooks
This commit is contained in:
@@ -343,9 +343,12 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
terminal.select(result.col, result.row, result.term.length);
|
terminal.select(result.col, result.row, result.term.length);
|
||||||
let scroll = result.row - terminal.buffer.viewportY;
|
// If it is not in the viewport then we scroll else it just gets selected
|
||||||
scroll = scroll - Math.floor(terminal.rows / 2);
|
if (result.row > (terminal.buffer.viewportY + terminal.rows) || result.row < terminal.buffer.viewportY) {
|
||||||
terminal.scrollLines(scroll);
|
let scroll = result.row - terminal.buffer.viewportY;
|
||||||
|
scroll = scroll - Math.floor(terminal.rows / 2);
|
||||||
|
terminal.scrollLines(scroll);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -644,7 +644,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
this.screenElement);
|
this.screenElement);
|
||||||
this._instantiationService.setService(ISelectionService, this._selectionService);
|
this._instantiationService.setService(ISelectionService, this._selectionService);
|
||||||
this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));
|
this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));
|
||||||
this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService.onMouseDown(e)));
|
|
||||||
this.register(this._selectionService.onRedrawRequest(e => this._renderService.onSelectionChanged(e.start, e.end, e.columnSelectMode)));
|
this.register(this._selectionService.onRedrawRequest(e => this._renderService.onSelectionChanged(e.start, e.end, e.columnSelectMode)));
|
||||||
this.register(this._selectionService.onLinuxMouseSelection(text => {
|
this.register(this._selectionService.onLinuxMouseSelection(text => {
|
||||||
// If there's a new selection, put it into the textarea, focus and select it
|
// If there's a new selection, put it into the textarea, focus and select it
|
||||||
@@ -665,6 +664,9 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
|||||||
this.register(this.onScroll(() => this._mouseZoneManager.clearAll()));
|
this.register(this.onScroll(() => this._mouseZoneManager.clearAll()));
|
||||||
this.linkifier.attachToDom(this.element, this._mouseZoneManager);
|
this.linkifier.attachToDom(this.element, this._mouseZoneManager);
|
||||||
|
|
||||||
|
// This event listener must be registered aftre MouseZoneManager is created
|
||||||
|
this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService.onMouseDown(e)));
|
||||||
|
|
||||||
// apply mouse event classes set by escape codes before terminal was attached
|
// apply mouse event classes set by escape codes before terminal was attached
|
||||||
if (this.mouseEvents) {
|
if (this.mouseEvents) {
|
||||||
this._selectionService.disable();
|
this._selectionService.disable();
|
||||||
|
|||||||
Reference in New Issue
Block a user