Create new event with emitter object to simplify code
This commit is contained in:
@@ -7,7 +7,7 @@ import { ILinkifier2, ILinkProvider, IBufferCellPosition, ILink, ILinkifierEvent
|
||||
import { IDisposable } from 'common/Types';
|
||||
import { IMouseService, IRenderService } from './services/Services';
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { EventEmitter, IEvent, initEvent } from 'common/EventEmitter';
|
||||
import { Disposable, getDisposeArrayDisposable, disposeArray } from 'common/Lifecycle';
|
||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||
|
||||
@@ -26,10 +26,8 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
private _activeProviderReplies: Map<Number, ILinkWithState[] | undefined> | undefined;
|
||||
private _activeLine: number = -1;
|
||||
|
||||
private readonly _onShowLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());
|
||||
public readonly onShowLinkUnderline = this._onShowLinkUnderline.event;
|
||||
private readonly _onHideLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());
|
||||
public readonly onHideLinkUnderline = this._onHideLinkUnderline.event;
|
||||
public readonly onShowLinkUnderline = this.register(initEvent<ILinkifierEvent>());
|
||||
public readonly onHideLinkUnderline = this.register(initEvent<ILinkifierEvent>());
|
||||
|
||||
constructor(
|
||||
@IBufferService private readonly _bufferService: IBufferService
|
||||
@@ -343,7 +341,7 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
|
||||
const range = link.range;
|
||||
const scrollOffset = this._bufferService.buffer.ydisp;
|
||||
const event = this._createLinkUnderlineEvent(range.start.x - 1, range.start.y - scrollOffset - 1, range.end.x, range.end.y - scrollOffset - 1, undefined);
|
||||
const emitter = showEvent ? this._onShowLinkUnderline : this._onHideLinkUnderline;
|
||||
const emitter = showEvent ? this.onShowLinkUnderline : this.onHideLinkUnderline;
|
||||
emitter.fire(event);
|
||||
}
|
||||
|
||||
|
||||
+22
-33
@@ -37,7 +37,7 @@ import { ITheme, IMarker, IDisposable, ILinkProvider, IDecorationOptions, IDecor
|
||||
import { DomRenderer } from 'browser/renderer/dom/DomRenderer';
|
||||
import { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types';
|
||||
import { evaluateKeyboardEvent } from 'common/input/Keyboard';
|
||||
import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';
|
||||
import { EventEmitter, IEvent, forwardEvent, initEvent } from 'common/EventEmitter';
|
||||
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||
import { ColorManager } from 'browser/ColorManager';
|
||||
import { RenderService } from 'browser/services/RenderService';
|
||||
@@ -122,27 +122,16 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
private _colorManager: ColorManager | undefined;
|
||||
private _theme: ITheme | undefined;
|
||||
|
||||
private readonly _onCursorMove = new EventEmitter<void>();
|
||||
public readonly onCursorMove = this._onCursorMove.event;
|
||||
private readonly _onKey = new EventEmitter<{ key: string, domEvent: KeyboardEvent }>();
|
||||
public readonly onKey = this._onKey.event;
|
||||
private readonly _onRender = new EventEmitter<{ start: number, end: number }>();
|
||||
public readonly onRender = this._onRender.event;
|
||||
private readonly _onSelectionChange = new EventEmitter<void>();
|
||||
public readonly onSelectionChange = this._onSelectionChange.event;
|
||||
private readonly _onTitleChange = new EventEmitter<string>();
|
||||
public readonly onTitleChange = this._onTitleChange.event;
|
||||
private readonly _onBell = new EventEmitter<void>();
|
||||
public readonly onBell = this._onBell.event;
|
||||
|
||||
private readonly _onFocus = new EventEmitter<void>();
|
||||
public readonly onFocus = this._onFocus.event;
|
||||
private readonly _onBlur = new EventEmitter<void>();
|
||||
public readonly onBlur = this._onBlur.event;
|
||||
private readonly _onA11yCharEmitter = new EventEmitter<string>();
|
||||
public readonly onA11yChar = this._onA11yCharEmitter.event;
|
||||
private readonly _onA11yTabEmitter = new EventEmitter<number>();
|
||||
public readonly onA11yTab = this._onA11yTabEmitter.event;
|
||||
public readonly onCursorMove = initEvent<void>();
|
||||
public readonly onKey = initEvent<{ key: string, domEvent: KeyboardEvent }>();
|
||||
public readonly onRender = initEvent<{ start: number, end: number }>();
|
||||
public readonly onSelectionChange = initEvent<void>();
|
||||
public readonly onTitleChange = initEvent<string>();
|
||||
public readonly onBell = initEvent<void>();
|
||||
public readonly onFocus = initEvent<void>();
|
||||
public readonly onBlur = initEvent<void>();
|
||||
public readonly onA11yChar = initEvent<string>();
|
||||
public readonly onA11yTab = initEvent<number>();
|
||||
|
||||
/**
|
||||
* Creates a new `Terminal` object.
|
||||
@@ -169,16 +158,16 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
this._instantiationService.setService(IDecorationService, this._decorationService);
|
||||
|
||||
// Setup InputHandler listeners
|
||||
this.register(this._inputHandler.onRequestBell(() => this._onBell.fire()));
|
||||
this.register(this._inputHandler.onRequestBell(() => this.onBell.fire()));
|
||||
this.register(this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end)));
|
||||
this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus()));
|
||||
this.register(this._inputHandler.onRequestReset(() => this.reset()));
|
||||
this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type)));
|
||||
this.register(this._inputHandler.onColor((event) => this._handleColorEvent(event)));
|
||||
this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove));
|
||||
this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange));
|
||||
this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter));
|
||||
this.register(forwardEvent(this._inputHandler.onA11yTab, this._onA11yTabEmitter));
|
||||
this.register(forwardEvent(this._inputHandler.onCursorMove, this.onCursorMove));
|
||||
this.register(forwardEvent(this._inputHandler.onTitleChange, this.onTitleChange));
|
||||
this.register(forwardEvent(this._inputHandler.onA11yChar, this.onA11yChar));
|
||||
this.register(forwardEvent(this._inputHandler.onA11yTab, this.onA11yTab));
|
||||
|
||||
// Setup listeners
|
||||
this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));
|
||||
@@ -326,7 +315,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
this.updateCursorStyle(ev);
|
||||
this.element!.classList.add('focus');
|
||||
this._showCursor();
|
||||
this._onFocus.fire();
|
||||
this.onFocus.fire();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,7 +338,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
this.coreService.triggerDataEvent(C0.ESC + '[O');
|
||||
}
|
||||
this.element!.classList.remove('focus');
|
||||
this._onBlur.fire();
|
||||
this.onBlur.fire();
|
||||
}
|
||||
|
||||
private _syncTextArea(): void {
|
||||
@@ -512,7 +501,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
const renderer = this._createRenderer();
|
||||
this._renderService = this.register(this._instantiationService.createInstance(RenderService, renderer, this.rows, this.screenElement));
|
||||
this._instantiationService.setService(IRenderService, this._renderService);
|
||||
this.register(this._renderService.onRenderedViewportChange(e => this._onRender.fire(e)));
|
||||
this.register(this._renderService.onRenderedViewportChange(e => this.onRender.fire(e)));
|
||||
this.onResize(e => this._renderService!.resize(e.cols, e.rows));
|
||||
|
||||
this._compositionView = document.createElement('div');
|
||||
@@ -552,7 +541,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
));
|
||||
this._instantiationService.setService(ISelectionService, this._selectionService);
|
||||
this.register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));
|
||||
this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));
|
||||
this.register(this._selectionService.onSelectionChange(() => this.onSelectionChange.fire()));
|
||||
this.register(this._selectionService.onRequestRedraw(e => this._renderService!.onSelectionChanged(e.start, e.end, e.columnSelectMode)));
|
||||
this.register(this._selectionService.onLinuxMouseSelection(text => {
|
||||
// If there's a new selection, put it into the textarea, focus and select it
|
||||
@@ -1101,7 +1090,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
this.textarea!.value = '';
|
||||
}
|
||||
|
||||
this._onKey.fire({ key: result.key, domEvent: event });
|
||||
this.onKey.fire({ key: result.key, domEvent: event });
|
||||
this._showCursor();
|
||||
this.coreService.triggerDataEvent(result.key, true);
|
||||
|
||||
@@ -1184,7 +1173,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
|
||||
key = String.fromCharCode(key);
|
||||
|
||||
this._onKey.fire({ key, domEvent: ev });
|
||||
this.onKey.fire({ key, domEvent: ev });
|
||||
this._showCursor();
|
||||
this.coreService.triggerDataEvent(key, true);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { IDisposable, IMarker, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm';
|
||||
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||
import { IEvent, EventEmitter, initEvent } from 'common/EventEmitter';
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IMouseService, IRenderService, ISelectionService } from 'browser/services/Services';
|
||||
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/Types';
|
||||
import { IColorSet, ITerminal, ILinkifier2, IBrowser, IViewport, IColorManager, ICompositionHelper, CharacterJoinerHandler, IBufferRange } from 'browser/Types';
|
||||
@@ -352,7 +352,7 @@ export class MockCoreBrowserService implements ICoreBrowserService {
|
||||
export class MockCharSizeService implements ICharSizeService {
|
||||
public serviceBrand: undefined;
|
||||
public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
||||
public onCharSizeChange: IEvent<void> = new EventEmitter<void>().event;
|
||||
public onCharSizeChange: IEvent<void> = initEvent<void>();
|
||||
constructor(public width: number, public height: number) {}
|
||||
public measure(): void {}
|
||||
}
|
||||
@@ -370,10 +370,10 @@ export class MockMouseService implements IMouseService {
|
||||
|
||||
export class MockRenderService implements IRenderService {
|
||||
public serviceBrand: undefined;
|
||||
public onDimensionsChange: IEvent<IRenderDimensions> = new EventEmitter<IRenderDimensions>().event;
|
||||
public onRenderedViewportChange: IEvent<{ start: number, end: number }, void> = new EventEmitter<{ start: number, end: number }>().event;
|
||||
public onRender: IEvent<{ start: number, end: number }, void> = new EventEmitter<{ start: number, end: number }>().event;
|
||||
public onRefreshRequest: IEvent<{ start: number, end: number}, void> = new EventEmitter<{ start: number, end: number }>().event;
|
||||
public onDimensionsChange: IEvent<IRenderDimensions> = initEvent<IRenderDimensions>();
|
||||
public onRenderedViewportChange: IEvent<{ start: number, end: number }, void> = initEvent<{ start: number, end: number }>();
|
||||
public onRender: IEvent<{ start: number, end: number }, void> = initEvent<{ start: number, end: number }>();
|
||||
public onRefreshRequest: IEvent<{ start: number, end: number}, void> = initEvent<{ start: number, end: number }>();
|
||||
public dimensions: IRenderDimensions = {
|
||||
scaledCharWidth: 0,
|
||||
scaledCharHeight: 0,
|
||||
@@ -457,10 +457,10 @@ export class MockSelectionService implements ISelectionService {
|
||||
public hasSelection: boolean = false;
|
||||
public selectionStart: [number, number] | undefined;
|
||||
public selectionEnd: [number, number] | undefined;
|
||||
public onLinuxMouseSelection = new EventEmitter<string>().event;
|
||||
public onRequestRedraw = new EventEmitter<ISelectionRedrawRequestEvent>().event;
|
||||
public onRequestScrollLines = new EventEmitter<ISelectionRequestScrollLinesEvent>().event;
|
||||
public onSelectionChange = new EventEmitter<void>().event;
|
||||
public onLinuxMouseSelection = initEvent<string>();
|
||||
public onRequestRedraw = initEvent<ISelectionRedrawRequestEvent>();
|
||||
public onRequestScrollLines = initEvent<ISelectionRequestScrollLinesEvent>();
|
||||
public onSelectionChange = initEvent<void>();
|
||||
public disable(): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export class BufferDecorationRenderer extends Disposable {
|
||||
// outside of viewport
|
||||
if (decoration.element) {
|
||||
decoration.element.style.display = 'none';
|
||||
decoration.onRenderEmitter.fire(decoration.element);
|
||||
decoration.onRender.fire(decoration.element);
|
||||
}
|
||||
} else {
|
||||
let element = this._decorationElements.get(decoration);
|
||||
@@ -108,7 +108,7 @@ export class BufferDecorationRenderer extends Disposable {
|
||||
}
|
||||
element.style.top = `${line * this._renderService.dimensions.actualCellHeight}px`;
|
||||
element.style.display = this._altBufferIsActive ? 'none' : 'block';
|
||||
decoration.onRenderEmitter.fire(element);
|
||||
decoration.onRender.fire(element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Disposable } from 'common/Lifecycle';
|
||||
import { IColorSet, ILinkifierEvent, ILinkifier2 } from 'browser/Types';
|
||||
import { ICharSizeService, ICoreBrowserService } from 'browser/services/Services';
|
||||
import { IOptionsService, IBufferService, IInstantiationService } from 'common/services/Services';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { EventEmitter, IEvent, initEvent } from 'common/EventEmitter';
|
||||
import { color } from 'common/Color';
|
||||
import { removeElementFromParent } from 'browser/Dom';
|
||||
|
||||
@@ -40,7 +40,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
||||
|
||||
public dimensions: IRenderDimensions;
|
||||
|
||||
public readonly onRequestRedraw = new EventEmitter<IRequestRedrawEvent>().event;
|
||||
public readonly onRequestRedraw = initEvent<IRequestRedrawEvent>();
|
||||
|
||||
constructor(
|
||||
private _colors: IColorSet,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { IOptionsService } from 'common/services/Services';
|
||||
import { IEvent, EventEmitter } from 'common/EventEmitter';
|
||||
import { IEvent, EventEmitter, initEvent } from 'common/EventEmitter';
|
||||
import { ICharSizeService } from 'browser/services/Services';
|
||||
|
||||
export class CharSizeService implements ICharSizeService {
|
||||
@@ -16,8 +16,7 @@ export class CharSizeService implements ICharSizeService {
|
||||
|
||||
public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }
|
||||
|
||||
private readonly _onCharSizeChange = new EventEmitter<void>();
|
||||
public readonly onCharSizeChange = this._onCharSizeChange.event;
|
||||
public readonly onCharSizeChange = initEvent<void>();
|
||||
|
||||
constructor(
|
||||
document: Document,
|
||||
@@ -32,7 +31,7 @@ export class CharSizeService implements ICharSizeService {
|
||||
if (result.width !== this.width || result.height !== this.height) {
|
||||
this.width = result.width;
|
||||
this.height = result.height;
|
||||
this._onCharSizeChange.fire();
|
||||
this.onCharSizeChange.fire();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { IRenderer, IRenderDimensions } from 'browser/renderer/Types';
|
||||
import { RenderDebouncer } from 'browser/RenderDebouncer';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { EventEmitter, IEvent, initEvent } from 'common/EventEmitter';
|
||||
import { Disposable } from 'common/Lifecycle';
|
||||
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
|
||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||
@@ -39,14 +39,10 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
columnSelectMode: false
|
||||
};
|
||||
|
||||
private readonly _onDimensionsChange = new EventEmitter<IRenderDimensions>();
|
||||
public readonly onDimensionsChange = this._onDimensionsChange.event;
|
||||
private readonly _onRenderedViewportChange = new EventEmitter<{ start: number, end: number }>();
|
||||
public readonly onRenderedViewportChange = this._onRenderedViewportChange.event;
|
||||
private readonly _onRender = new EventEmitter<{ start: number, end: number }>();
|
||||
public readonly onRender = this._onRender.event;
|
||||
private readonly _onRefreshRequest = new EventEmitter<{ start: number, end: number }>();
|
||||
public readonly onRefreshRequest = this._onRefreshRequest.event;
|
||||
public readonly onDimensionsChange = initEvent<IRenderDimensions>();
|
||||
public readonly onRenderedViewportChange = initEvent<{ start: number, end: number }>();
|
||||
public readonly onRender = initEvent<{ start: number, end: number }>();
|
||||
public readonly onRefreshRequest = initEvent<{ start: number, end: number }>();
|
||||
|
||||
public get dimensions(): IRenderDimensions { return this._renderer.dimensions; }
|
||||
|
||||
@@ -135,9 +131,9 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
|
||||
// Fire render event only if it was not a redraw
|
||||
if (!this._isNextRenderRedrawOnly) {
|
||||
this._onRenderedViewportChange.fire({ start, end });
|
||||
this.onRenderedViewportChange.fire({ start, end });
|
||||
}
|
||||
this._onRender.fire({ start, end });
|
||||
this.onRender.fire({ start, end });
|
||||
this._isNextRenderRedrawOnly = true;
|
||||
}
|
||||
|
||||
@@ -157,7 +153,7 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
if (this._renderer.dimensions.canvasWidth === this._canvasWidth && this._renderer.dimensions.canvasHeight === this._canvasHeight) {
|
||||
return;
|
||||
}
|
||||
this._onDimensionsChange.fire(this._renderer.dimensions);
|
||||
this.onDimensionsChange.fire(this._renderer.dimensions);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IBufferLine, IDisposable } from 'common/Types';
|
||||
import * as Browser from 'common/Platform';
|
||||
import { SelectionModel } from 'browser/selection/SelectionModel';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { EventEmitter, IEvent } from 'common/EventEmitter';
|
||||
import { EventEmitter, IEvent, initEvent } from 'common/EventEmitter';
|
||||
import { IMouseService, ISelectionService, IRenderService, ICoreBrowserService } from 'browser/services/Services';
|
||||
import { IBufferRange, ILinkifier2 } from 'browser/Types';
|
||||
import { IBufferService, IOptionsService, ICoreService } from 'common/services/Services';
|
||||
@@ -111,14 +111,10 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
private _oldSelectionStart: [number, number] | undefined = undefined;
|
||||
private _oldSelectionEnd: [number, number] | undefined = undefined;
|
||||
|
||||
private readonly _onLinuxMouseSelection = this.register(new EventEmitter<string>());
|
||||
public readonly onLinuxMouseSelection = this._onLinuxMouseSelection.event;
|
||||
private readonly _onRedrawRequest = this.register(new EventEmitter<ISelectionRedrawRequestEvent>());
|
||||
public readonly onRequestRedraw = this._onRedrawRequest.event;
|
||||
private readonly _onSelectionChange = this.register(new EventEmitter<void>());
|
||||
public readonly onSelectionChange = this._onSelectionChange.event;
|
||||
private readonly _onRequestScrollLines = this.register(new EventEmitter<ISelectionRequestScrollLinesEvent>());
|
||||
public readonly onRequestScrollLines = this._onRequestScrollLines.event;
|
||||
public readonly onLinuxMouseSelection = this.register(initEvent<string>());
|
||||
public readonly onRequestRedraw = this.register(initEvent<ISelectionRedrawRequestEvent>());
|
||||
public readonly onSelectionChange = this.register(initEvent<void>());
|
||||
public readonly onRequestScrollLines = this.register(initEvent<ISelectionRequestScrollLinesEvent>());
|
||||
|
||||
constructor(
|
||||
private readonly _element: HTMLElement,
|
||||
@@ -260,7 +256,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
this._model.clearSelection();
|
||||
this._removeMouseDownListeners();
|
||||
this.refresh();
|
||||
this._onSelectionChange.fire();
|
||||
this.onSelectionChange.fire();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,7 +275,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
if (Browser.isLinux && isLinuxMouseSelection) {
|
||||
const selectionText = this.selectionText;
|
||||
if (selectionText.length) {
|
||||
this._onLinuxMouseSelection.fire(this.selectionText);
|
||||
this.onLinuxMouseSelection.fire(this.selectionText);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,7 +286,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
*/
|
||||
private _refresh(): void {
|
||||
this._refreshAnimationFrame = undefined;
|
||||
this._onRedrawRequest.fire({
|
||||
this.onRequestRedraw.fire({
|
||||
start: this._model.finalSelectionStart,
|
||||
end: this._model.finalSelectionEnd,
|
||||
columnSelectMode: this._activeSelectionMode === SelectionMode.COLUMN
|
||||
@@ -358,7 +354,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
public selectAll(): void {
|
||||
this._model.isSelectAllActive = true;
|
||||
this.refresh();
|
||||
this._onSelectionChange.fire();
|
||||
this.onSelectionChange.fire();
|
||||
}
|
||||
|
||||
public selectLines(start: number, end: number): void {
|
||||
@@ -368,7 +364,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
this._model.selectionStart = [0, start];
|
||||
this._model.selectionEnd = [this._bufferService.cols, end];
|
||||
this.refresh();
|
||||
this._onSelectionChange.fire();
|
||||
this.onSelectionChange.fire();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -665,7 +661,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
return;
|
||||
}
|
||||
if (this._dragScrollAmount) {
|
||||
this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });
|
||||
this.onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });
|
||||
// Re-evaluate selection
|
||||
// If the cursor was above or below the viewport, make sure it's at the
|
||||
// start or end of the viewport respectively. This should only happen when
|
||||
@@ -743,7 +739,7 @@ export class SelectionService extends Disposable implements ISelectionService {
|
||||
this._oldSelectionStart = start;
|
||||
this._oldSelectionEnd = end;
|
||||
this._oldHasSelection = hasSelection;
|
||||
this._onSelectionChange.fire();
|
||||
this.onSelectionChange.fire();
|
||||
}
|
||||
|
||||
private _onBufferActivate(e: {activeBuffer: IBuffer, inactiveBuffer: IBuffer}): void {
|
||||
|
||||
Reference in New Issue
Block a user