Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

The right margin of editor mode should be symmetrical as the left margin (just like in the preview mode)

Open Fallgrim opened this issue 2 months ago • 4 comments

What problem would this solve?

  • It's too close to the right. I think it should be symmetrical as the left side. The screenshots show it with the table of contents, but the problem is same without table of contents too.

Screenshots

Image Image

Fallgrim avatar Oct 03 '26 10:10 Fallgrim

The space on the left of the editor isn't a page margin. When the outline isn't pinned, it keeps the floating outline button off the text, and line numbers sit there when they're on. The right side has nothing to reserve, so the text runs up to the scrollbar.

The easy fix is to reserve that space only while the button is actually over the editor. With the outline pinned, as in your screenshots, the left gap would shrink.

Notes
  • With line numbers off, lineDecorationsWidth in src/lib/utils/editorOptions.ts adds a fixed 42px (TOC_BUTTON_CLEARANCE, from #812) for the 28px button at left: 8px.
  • When the outline is expanded, .toc-toggle-floating.expanded moves the button into the outline panel, so the 42px clears nothing. Same with tocSide: right: the button sits at the editor's right edge, but the clearance stays on the left.
  • Monaco has no right padding option. A matching gap on the right would need wordWrapColumn computed from the viewport width, which isn't worth it here.

PathGao avatar Oct 03 '26 13:10 PathGao

your theme looks nice,what is it

PathGao avatar Oct 03 '26 13:10 PathGao

It's Kanagawa.

Fallgrim avatar Oct 03 '26 13:10 Fallgrim

reopend, because we can still do some thing about it

PathGao avatar Oct 03 '26 16:10 PathGao