microsoft / microsoft/monaco-editor

[Feature Request] [Diff Editor] Option to configure the merge direction in the Diff Editor

Open
#4,932 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

Currently in the multiline Diff Editor, the default configuration of the arrow is from LHS to RHS.

Image

As part of our internal convention for our product, RHS is always read-only. LHS is editable and differences are allowed to be moved from RHS to LHS. This can be configured in the diff editor by the below option

{
..
originalEditable : true,
readOnly : true
..
}

But the above configuration disables the merge arrows as well.

Requested Feature:
Configure the arrow direction from Right to Left for multiline Diff Editor so that even when the RHS is read only and LHS is editable the merge arrows appears.

{
..
mergeDirection : "leftToRight" | "rightToLeft",
..
}

Related Issues:
#368: "Allow to configure which side of the diff editor is editable" (https://github.com/Microsoft/Monaco-editor/issues/368)
This previous feature request from 2017 asked for similar functionality to configure editable sides
While that request focused on making both sides editable, this request specifically aims to reverse the default behavior of the merge arrow directions
The current request builds upon the same concept but with a more specific use case and additional arrow direction configuration

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

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

No source files, tests, or runnable Playground example are named. Start by locating the multiline Diff Editor configuration and the existing merge-arrow behavior, then verify how originalEditable and readOnly affect it. Done means a documented mergeDirection option supports right-to-left arrows while preserving the existing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.