未验证 提交 73b5307a 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #95830 from dustypomerleau/hl

change all instances of `wordHighligher` to `wordHighlighter`
...@@ -483,20 +483,20 @@ class WordHighlighterContribution extends Disposable implements IEditorContribut ...@@ -483,20 +483,20 @@ class WordHighlighterContribution extends Disposable implements IEditorContribut
return editor.getContribution<WordHighlighterContribution>(WordHighlighterContribution.ID); return editor.getContribution<WordHighlighterContribution>(WordHighlighterContribution.ID);
} }
private wordHighligher: WordHighlighter | null; private wordHighlighter: WordHighlighter | null;
constructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { constructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) {
super(); super();
this.wordHighligher = null; this.wordHighlighter = null;
const createWordHighlighterIfPossible = () => { const createWordHighlighterIfPossible = () => {
if (editor.hasModel()) { if (editor.hasModel()) {
this.wordHighligher = new WordHighlighter(editor, contextKeyService); this.wordHighlighter = new WordHighlighter(editor, contextKeyService);
} }
}; };
this._register(editor.onDidChangeModel((e) => { this._register(editor.onDidChangeModel((e) => {
if (this.wordHighligher) { if (this.wordHighlighter) {
this.wordHighligher.dispose(); this.wordHighlighter.dispose();
this.wordHighligher = null; this.wordHighlighter = null;
} }
createWordHighlighterIfPossible(); createWordHighlighterIfPossible();
})); }));
...@@ -504,34 +504,34 @@ class WordHighlighterContribution extends Disposable implements IEditorContribut ...@@ -504,34 +504,34 @@ class WordHighlighterContribution extends Disposable implements IEditorContribut
} }
public saveViewState(): boolean { public saveViewState(): boolean {
if (this.wordHighligher && this.wordHighligher.hasDecorations()) { if (this.wordHighlighter && this.wordHighlighter.hasDecorations()) {
return true; return true;
} }
return false; return false;
} }
public moveNext() { public moveNext() {
if (this.wordHighligher) { if (this.wordHighlighter) {
this.wordHighligher.moveNext(); this.wordHighlighter.moveNext();
} }
} }
public moveBack() { public moveBack() {
if (this.wordHighligher) { if (this.wordHighlighter) {
this.wordHighligher.moveBack(); this.wordHighlighter.moveBack();
} }
} }
public restoreViewState(state: boolean | undefined): void { public restoreViewState(state: boolean | undefined): void {
if (this.wordHighligher && state) { if (this.wordHighlighter && state) {
this.wordHighligher.restore(); this.wordHighlighter.restore();
} }
} }
public dispose(): void { public dispose(): void {
if (this.wordHighligher) { if (this.wordHighlighter) {
this.wordHighligher.dispose(); this.wordHighlighter.dispose();
this.wordHighligher = null; this.wordHighlighter = null;
} }
super.dispose(); super.dispose();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册