Monaco-editor: [diff editor] option to remove 'diffOverviewRuler'

Created on 29 Nov 2019  路  7Comments  路  Source: microsoft/monaco-editor

Feature Request

I'd like to know if it is possible to add an option to be able to remove the diffOverviewRuler when creating Diff Editors.

If not, is there a recommended way to remove the diffOverviewRuler?

Screen Shot 2019-11-28 at 6 42 59 PM

Additional Information

monaco-editor version: 0.18.1
Browser: Chrome v.78
OS: macOS Mojave 10.14.6

diff-editor feature-request

Most helpful comment

Yes, totally. I also want to remove the diffBar. Thats how I ended up in your issue.
AFAIK the only way to do that right now is with some CSS hacks. Which isn't great, but doable. Hopefully someone from the VSCode notices. :)

In my codebase where we made the CSS hack I left a link to this issue to remind my self to occasionally check on it.

All 7 comments

I was also trying to remove this. There is an option for overviewRulerLanes but setting that to 0 doesn't seem to do the trick.

For our application we're only using the editor, and not the entire layout, so I was able to kind of hack this with CSS.

I set the diffOverview div to display: none; and then set the width of the entire editor to calc(100% + 30px) (30px being the default width of the ruler)

I'm not sure if that is helpful in your case since you have the rest of the application visible.

I was also trying to remove this. There is an option for overviewRulerLanes but setting that to 0 doesn't seem to do the trick.

For our application we're only using the editor, and not the entire layout, so I was able to kind of hack this with CSS.

I set the diffOverview div to display: none; and then set the width of the entire editor to calc(100% + 30px) (30px being the default width of the ruler)

I'm not sure if that is helpful in your case since you have the rest of the application visible.

Thanks for the reply!
I've also noticed others using CSS to remove it, but I'd rather only do so if absolutely necessary.
I feel as though if many are attempting to remove it, it'd be better to support it out of the box through an option. This way everyone won't need to be hacking it out :(

I discovered yesterday while doing some more CSS tweaking that overviewRuler and diffOverview are different things. Setting overviewRulerLanes does in fact remove the lanes from the overviewRuler.

Setting overviewRulerLanes does in fact remove the lanes from the overviewRuler.

Do you mean you've set the overviewRulerLanes to 0 when creating diff editors?

_Update_:
I've tried using the monaco playground (diff editor example) and it did not seem to remove the secondary vertical scrollbar.

Do you mean you've set the overviewRulerLanes to 0 when creating diff editors?

Yes. But the overviewRuler is not the scroller that has the diff changes in it. It's the tiny ruler just inside it that shows the cursor location.

The bottom picture has overviewRulerLanes: 0

Screen_Shot_2019-12-05_at_3_47_00_PM

Do you mean you've set the overviewRulerLanes to 0 when creating diff editors?

Yes. But the overviewRuler is not the scroller that has the diff changes in it. It's the tiny ruler just inside it that shows the cursor location.

The bottom picture has overviewRulerLanes: 0

Screen_Shot_2019-12-05_at_3_47_00_PM

Ah I see. I'm more looking for an option to remove the scrollbar with the diff changes.
At the moment, the only way to remove it as far as I know is to hack it out using CSS.
I propose that it should be configurable through an option :)

Yes, totally. I also want to remove the diffBar. Thats how I ended up in your issue.
AFAIK the only way to do that right now is with some CSS hacks. Which isn't great, but doable. Hopefully someone from the VSCode notices. :)

In my codebase where we made the CSS hack I left a link to this issue to remind my self to occasionally check on it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreymarchenko picture andreymarchenko  路  3Comments

galusben picture galusben  路  3Comments

Spongman picture Spongman  路  3Comments

brandalorian picture brandalorian  路  3Comments

galyech picture galyech  路  3Comments