Margin width adjustment with Line Numbering (NOT Readable Line Length)

Can anyone help with adjusting the margins, and please I’m not talking about the Readable Line Length

I have the Readable Line Length on, but as I’ve lately discovered the advantages of having Line Numbering on, what happens is, the right margin stays where it is, and the left margin moves over, to make way for the line numbers.

I would much prefer it, if the left margin stayed where it was, and the line numbers moved into the empty space of the left margin.

Is there some code snippet that allows me to keep the two margins as they are, and have the line numbering drop into the left margin, instead of line numbering pushing the left margin over to the right?

Here are two screenshots to hopefully illustrate my point, first with line numberng off, second with it switched on.
(the thin line below the heading gives a clear indication where the margin is)
(you can see to the right, the thin line stays where it is. To the left, the thin line together with Heading move in to the right. Line numbers are now where the left margin was)

What I would like, is that the 'text margins stay where they are, and the line numbering lands in the left hand margin, if that makes sense.

Many thanks!

Edit: it also conflicts horribly with Outlining


I’m guessing you’re using the default theme, and I’m not quite sure what actually governs this style. I’m using Minimal theme, and the line numbers are all the way to the left.

I’m also seeing that the .cm-contentContainer in Minimal is encompassing the entire workspace window (or tab), whilst in the default theme the margins have already been applied to it. So I reckon this needs to be changed, and then after changing that one needs to address the .cm-gutters margins/padding, and finally the .cm-content which is actually holding the content.

I also see that within Minimal the .cm-line has a margin-left: 100.37px, whilst it’s zero in the default theme. And it seems like Minimal is using a position: absolute on the .cm-gutters.

So, the answer is “Yes, it’s possible”, but sadly I don’t know the precise details to get this going within the default theme. However, these pointers might be enough to get you started, if you know a little CSS?

Fablous thanks @holroy, yes indeed these were enough. Knowing a little CSS certainly helps around here lol

I am using the default theme as it happens, but only changed to it in the past couple of days. Mainly have used Encore, and 2-3 others, until it recently got horrible update :frowning:

Anyhow, point is, I see that with different themes it does all behave differently. Sodalite does the job best, so I’ll stick with that for now.

Very much appreciated :heart:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.