Skip to content

Commit

Permalink
Warning not shown in readonly settings editor for commands such as co…
Browse files Browse the repository at this point in the history
…py paste (fixes #37360)
  • Loading branch information
bpasero committed Nov 1, 2017
1 parent 0c7f237 commit 95740d0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,13 @@ export class DefaultPreferencesEditor extends BaseTextEditor {
const editor = this.instantiationService.createInstance(DefaultPreferencesCodeEditor, parent.getHTMLElement(), configuration);

// Inform user about editor being readonly if user starts type
this.toUnbind.push(editor.onDidType(() => this.onDidType(editor)));
this.toUnbind.push(editor.onDidType(() => this.showReadonlyHint(editor)));
this.toUnbind.push(editor.onDidPaste(() => this.showReadonlyHint(editor)));

return editor;
}

private onDidType(editor: editorCommon.ICommonCodeEditor): void {
private showReadonlyHint(editor: editorCommon.ICommonCodeEditor): void {
const messageController = MessageController.get(editor);
if (!messageController.isVisible()) {
messageController.showMessage(nls.localize('defaultEditorReadonly', "Edit in the right hand side editor to override defaults."), editor.getSelection().getPosition());
Expand Down

0 comments on commit 95740d0

Please sign in to comment.