Skip to content

Commit

Permalink
Fixes microsoft#4414: Do not do selection highlighting when typing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Mar 18, 2016
1 parent 0d9f633 commit 77dc2ee
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/vs/editor/contrib/find/common/findController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,24 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd
this.editor = editor;
this.decorations = [];

this._register(editor.addListener2(editorCommon.EventType.CursorPositionChanged, _ => this._update()));
this._register(editor.addListener2(editorCommon.EventType.CursorSelectionChanged, (e: editorCommon.ICursorSelectionChangedEvent) => {
if (e.selection.isEmpty()) {
if (e.reason === 'explicit') {
this._update();
} else {
this.removeDecorations();

}
} else {
this._update();
}
}));
this._register(editor.addListener2(editorCommon.EventType.ModelChanged, (e) => {
this.removeDecorations();
}));
this._register(CommonFindController.getFindController(editor).getState().addChangeListener((e) => this._update()));
this._register(CommonFindController.getFindController(editor).getState().addChangeListener((e) => {
this._update();
}));
}

public getId(): string {
Expand Down

0 comments on commit 77dc2ee

Please sign in to comment.