AvaloniaUI / AvaloniaEdit

Avalonia-based text editor (port of AvalonEdit)
MIT License
702 stars 138 forks source link

Remove margin around TextEditor #419

Open mgarstenauer opened 2 months ago

mgarstenauer commented 2 months ago

This is a cosmetic PR that removes the 30px margin around the TextEditor in the demo.

Before: image

After: image

(Looking at the git history, the Margin has been there for the last 7+ years. I don't think that the margin serves any purpose. Let's remove it to avoid any confusion!)

Rekkonnect commented 1 month ago

Most code editors have a margin on the line number panel to make it more readable and prettier. Removing the margin feels much worse to me.

mgarstenauer commented 1 month ago

@Rekkonnect Thanks for the feedback. I was mainly worried about the margins on the other sides. Having space between the scrollbars and the window, felt like a bug.

I pushed a small change. Keep some margin on the left for readability, remove the top/right/bottom margins. Here is what it looks like:

image

mgarstenauer commented 1 month ago

I increased the minimum size of the LineNumberMargin. This ensures that there is enough space between the line numbers and any other text editor margins.

Together with the breakpoint margin it looks like this: image