Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] When multiple Monaco editors exist simultaneously, the theme of each editor is forced to be unified #4425

Open
1 of 2 tasks
AmamiyaCx opened this issue Mar 14, 2024 · 1 comment

Comments

@AmamiyaCx
Copy link

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.47.0#XQAAAALRAgAAAAAAAABBqQkHQ5NjdQ_RJUhUwcsQIjjaoVayL-wYsMegjl4CeMe41v0rTlvQg_cBWS-b8aKgtqNV_EaBcxS_fzmS3coRB-IUAZyHk6adB6Fs2WGc2NlTO8dS2o-OecOzEBgerpUkIz_W1TLfpyf-wT0AH0ls9IOttAtxY9uWs7n9RY7yvoNkhFoczkjako1__1VsJA4Hbo-zC8JsKH90CD5mrl5KFd4lqQzQ63vMMnapr9wYbN3mM-N9cKSu9JagbHGR54bVOpVvbl1lxSY_14K9IPw-daMLHK3IhYVsNfIDyW4c46-J7i6PqF8CABVF5pMTdGNSAFAIjjG10MUHwMqdIXN1ofTW0HUXAWYEMfZH370HubTKX1QTwki4RYAS6A0rAlnCISY9fhoO55VVW8qQ5KdV2keowfzLZK1rPnSTO__jwwyDMKyxMBiq31b72zBY

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
}`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	theme: 'vs',
	language: "javascript",
	automaticLayout: true,
});

const value2 = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
}`;

// Hover on each property to see its docs!
const myEditor2 = monaco.editor.create(document.getElementById("container2"), {
	value,
	language: "javascript",
	theme: 'vs-dark',
	automaticLayout: true,
});

Reproduction Steps

1、Create an editor and set the theme to 'vs'
2、Create a second editor with the theme 'vs-dark'

Actual (Problematic) Behavior

The themes of the two Monaco editors are the same

Expected Behavior

Each Monaco editor should apply its own theme

Additional Context

No response

@Prinzhorn
Copy link

First search result #338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants