microsoft / microsoft/monaco-editor

[Bug] DiffEditor with glyphMargin: false, still renders glyphMargin when rendered side by side.

Open
#4,448 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

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#XQAAAALtAgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw2niNxqjsAD0-ojp5wJqOvqwlfzL0lj1q0QqHuzP9sldHeU38FrR0K4YSNEzAxFQQ9UAeGugw0A9vzG322o22aQJt8vF_OJ-CiyIUlTmYgwXhvFtZiw6vrXxme9hCDg0OSXvg7TEw1rd5V-g1Rh4pXehVYLGJO58JoRabIuhycF9fYiANRmdlMDG_x4x7X5uR8Gm4lmfiETNh5JL3NutP1l6kwWkkSWqtzDKnuuJOebjhyPN4a5BoXB22z2dKOVlw4AR7NJNK-Yx-v5AS2uecQIu28EXPMqKKuAIFUQdUC2vD4A1-Eq2elmVkc30fvf6wfKbqCV8csEmmzWkTjUZdGzJO5XEGUxbONootGNFsFj4DD2WWbg0ecs4xKnlRDqT_fWSvMAc3JIGEqp3aPiRD-N3W4ZjuA5ewcsIqJq5GH6c1433sBxEGaZvEate8YaLK_xtvmgA

Monaco Editor Playground Code
var originalModel = monaco.editor.createModel(
	"This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text",
	"text/plain"
);
var modifiedModel = monaco.editor.createModel(
	"just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.",
	"text/plain"
);

var diffEditor = monaco.editor.createDiffEditor(
	document.getElementById("container"),
	{
		// Renders without glyph margin
		// renderSideBySide: false,
		// glyphMargin: false,

		// Still shows glyphMargin
		renderSideBySide: true,
		useInlineViewWhenSpaceIsLimited: false,
		glyphMargin: false,
	}
);
diffEditor.setModel({
	original: originalModel,
	modified: modifiedModel,
});
Reproduction Steps

Set these options and observe that the glyph margin is still shown.
renderSideBySide: true,
useInlineViewWhenSpaceIsLimited: false,
glyphMargin: false,

monaco-editor-0 47 0-glyph-margin-side-by-side-diff

Actual (Problematic) Behavior

Glyph margin is turned off, but still renders when the diff editor is in side by side mode.

Expected Behavior

I would expect, regardless of whether it is rendered in side by side or not, that if glyphMargin is set to false, then glyphMargin should not be shown,

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Monaco Editor Playground reproduction and the createDiffEditor options shown in the issue, comparing side-by-side and inline rendering. Trace how glyphMargin is applied when renderSideBySide is true; done means glyphMargin remains hidden in side-by-side mode when set to false, without changing the inline behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.