Remove Events.ts in favor of new Event.forward

This commit is contained in:
Daniel Imms
2024-07-14 08:50:37 -07:00
parent 460a1370d7
commit ae8f2dd61a
10 changed files with 33 additions and 53 deletions
+5 -6
View File
@@ -44,7 +44,6 @@ import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, ILinkPr
import { ThemeService } from 'browser/services/ThemeService';
import { channels, color } from 'common/Color';
import { CoreTerminal } from 'common/CoreTerminal';
import { forwardEvent } from 'common/Events';
import { MutableDisposable, toDisposable } from 'common/Lifecycle';
import * as Browser from 'common/Platform';
import { ColorRequestType, CoreMouseAction, CoreMouseButton, CoreMouseEventType, IColorEvent, ITerminalOptions, KeyboardResultType, SpecialColorIndex } from 'common/Types';
@@ -58,7 +57,7 @@ import { IDecorationService } from 'common/services/Services';
import { WindowsOptionsReportType } from '../common/InputHandler';
import { AccessibilityManager } from './AccessibilityManager';
import { Linkifier } from './Linkifier';
import { Emitter, type Event } from 'vs/base/common/event';
import { Emitter, Event } from 'vs/base/common/event';
export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
public textarea: HTMLTextAreaElement | undefined;
@@ -166,10 +165,10 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
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(Event.forward(this._inputHandler.onCursorMove, this._onCursorMove));
this.register(Event.forward(this._inputHandler.onTitleChange, this._onTitleChange));
this.register(Event.forward(this._inputHandler.onA11yChar, this._onA11yCharEmitter));
this.register(Event.forward(this._inputHandler.onA11yTab, this._onA11yTabEmitter));
// Setup listeners
this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));
+2 -3
View File
@@ -5,9 +5,8 @@
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
import { ICoreBrowserService } from './Services';
import { forwardEvent } from 'common/Events';
import { addDisposableDomListener } from 'browser/Lifecycle';
import { Emitter } from 'vs/base/common/event';
import { Emitter, Event } from 'vs/base/common/event';
export class CoreBrowserService extends Disposable implements ICoreBrowserService {
public serviceBrand: undefined;
@@ -30,7 +29,7 @@ export class CoreBrowserService extends Disposable implements ICoreBrowserServic
// Monitor device pixel ratio
this.register(this.onWindowChange(w => this._screenDprMonitor.setWindow(w)));
this.register(forwardEvent(this._screenDprMonitor.onDprChange, this._onDprChange));
this.register(Event.forward(this._screenDprMonitor.onDprChange, this._onDprChange));
this.register(
addDisposableDomListener(this._textarea, 'focus', () => (this._isFocused = true))