mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Merge branch 'master' into ben/stacks
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {toErrorMessage, onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {IEmitterEvent} from 'vs/base/common/eventEmitter';
|
||||
import {EmitterEvent} from 'vs/base/common/eventEmitter';
|
||||
import {IModelService} from 'vs/editor/common/services/modelService';
|
||||
import * as EditorCommon from 'vs/editor/common/editorCommon';
|
||||
import {MirrorModel2} from 'vs/editor/common/model/mirrorModel2';
|
||||
@@ -551,7 +551,7 @@ export class MainThreadDocuments {
|
||||
this._proxy._acceptModelRemoved(modelUrl.toString());
|
||||
}
|
||||
|
||||
private _onModelEvents(modelUrl: URI, events: IEmitterEvent[]): void {
|
||||
private _onModelEvents(modelUrl: URI, events: EmitterEvent[]): void {
|
||||
let changedEvents: EditorCommon.IModelContentChangedEvent2[] = [];
|
||||
for (let i = 0, len = events.length; i < len; i++) {
|
||||
let e = events[i];
|
||||
|
||||
@@ -132,7 +132,7 @@ export class MainThreadFileSystemEventService {
|
||||
events.deleted.length = 0;
|
||||
}, 100);
|
||||
|
||||
eventService.addListener('files:fileChanges', (event: FileChangesEvent) => {
|
||||
eventService.addListener2('files:fileChanges', (event: FileChangesEvent) => {
|
||||
for (let change of event.changes) {
|
||||
switch (change.type) {
|
||||
case FileChangeType.ADDED:
|
||||
|
||||
@@ -127,7 +127,7 @@ export class MainThreadTextEditor {
|
||||
if (this._codeEditor) {
|
||||
|
||||
// Catch early the case that this code editor gets a different model set and disassociate from this model
|
||||
this._codeEditorListeners.push(this._codeEditor.addListener2(EditorCommon.EventType.ModelChanged, () => {
|
||||
this._codeEditorListeners.push(this._codeEditor.onDidModelChange(() => {
|
||||
this.setCodeEditor(null);
|
||||
}));
|
||||
|
||||
@@ -135,17 +135,17 @@ export class MainThreadTextEditor {
|
||||
this._lastSelection = this._codeEditor.getSelections();
|
||||
this._onSelectionChanged.fire(this._lastSelection);
|
||||
};
|
||||
this._codeEditorListeners.push(this._codeEditor.addListener2(EditorCommon.EventType.CursorSelectionChanged, forwardSelection));
|
||||
this._codeEditorListeners.push(this._codeEditor.onDidCursorSelectionChange(forwardSelection));
|
||||
if (!Selection.selectionsArrEqual(this._lastSelection, this._codeEditor.getSelections())) {
|
||||
forwardSelection();
|
||||
}
|
||||
this._codeEditorListeners.push(this._codeEditor.addListener2(EditorCommon.EventType.EditorFocus, () => {
|
||||
this._codeEditorListeners.push(this._codeEditor.onDidEditorFocus(() => {
|
||||
this._focusTracker.onGainedFocus();
|
||||
}));
|
||||
this._codeEditorListeners.push(this._codeEditor.addListener2(EditorCommon.EventType.EditorBlur, () => {
|
||||
this._codeEditorListeners.push(this._codeEditor.onDidEditorBlur(() => {
|
||||
this._focusTracker.onLostFocus();
|
||||
}));
|
||||
this._codeEditorListeners.push(this._codeEditor.addListener2(EditorCommon.EventType.ConfigurationChanged, () => {
|
||||
this._codeEditorListeners.push(this._codeEditor.onDidConfigurationChange(() => {
|
||||
this._setConfiguration(this._readConfiguration(this._model, this._codeEditor));
|
||||
}));
|
||||
this._setConfiguration(this._readConfiguration(this._model, this._codeEditor));
|
||||
@@ -407,7 +407,7 @@ export class MainThreadEditorsTracker {
|
||||
}
|
||||
|
||||
private _onCodeEditorAdd(codeEditor: EditorCommon.ICommonCodeEditor): void {
|
||||
this._editorModelChangeListeners[codeEditor.getId()] = codeEditor.addListener2(EditorCommon.EventType.ModelChanged, _ => this._updateMapping.schedule());
|
||||
this._editorModelChangeListeners[codeEditor.getId()] = codeEditor.onDidModelChange(_ => this._updateMapping.schedule());
|
||||
this._updateMapping.schedule();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user