Skip to content

Commit

Permalink
We add the input decoration only when the focus is in the input
Browse files Browse the repository at this point in the history
fixes #61126
  • Loading branch information
isidorn committed Oct 17, 2018
1 parent eef12f8 commit d08e540
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vs/workbench/parts/debug/electron-browser/repl.ts
Expand Up @@ -349,6 +349,9 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
this._register(this.replInput.onDidChangeModelContent(() => {
this.historyNavigationEnablement.set(this.replInput.getModel().getValue() === '');
}));
// We add the input decoration only when the focus is in the input #61126
this._register(this.replInput.onDidFocusEditorText(() => this.updateInputDecoration()));
this._register(this.replInput.onDidBlurEditorText(() => this.updateInputDecoration()));

this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.FOCUS, () => dom.addClass(this.replInputContainer, 'synthetic-focus')));
this._register(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.BLUR, () => dom.removeClass(this.replInputContainer, 'synthetic-focus')));
Expand Down Expand Up @@ -382,7 +385,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
}

const decorations: IDecorationOptions[] = [];
if (this.isReadonly) {
if (this.isReadonly && this.replInput.hasTextFocus()) {
decorations.push({
range: {
startLineNumber: 0,
Expand Down

0 comments on commit d08e540

Please sign in to comment.