Line numbers affect text indent

Hi, I’ve moved my config from WSL on windows to an actual Ubuntu install, and now the width of the line number affects the indentation of text in the buffer - so when I’m in relative line number mode and I move the cursor down the buffer, there’s constant shiftimg back and forth of lines - sine the line I’m currently on has its actual number (e.g 310) and the lines all around have much lower numbers with less digits…

I have the following in my config (though I don’t imagine it matters much):

(custom-theme-set-faces 'user
                        `(line-number ((t (:inherit default :foreground "#6599bf" :strike-through nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "ADBO" :family "Source Code Pro"))))
                        ;; `(line-number ((t (:inherit default :foreground "#3f444a" :strike-through nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "ADBO" :family "Source Code Pro"))))
                        `(line-number-current-line ((t (:inherit (hl-line default) :foreground "#bbc2cf" :strike-through nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "ADBO" :family "Source Code Pro"))))

System information

Loading data dump...

This is a known effect of setting display-line-numbers-width too low. Try bumping it to 3 say.

I’ve actually tried that before, to no avail… I’ve set it to 5 now, and it’s still the same.

I don’t have any such issues with this config:

(setq display-line-numbers-grow-only   t
      display-line-numbers-type        'relative
      display-line-numbers-width-start t)

thanks! but these are all already set for me…

[video-to-gif output image]

Just putting this here if someone is facing the same issue. I’ve had the same problem in my setup when I tried to switch to Hasklug Mono.

This causes the jumping when a line number is highlighted or changes:

(setq doom-font (font-spec :family "Hasklug Nerd Font" :size 16))

This doesn’t:

(setq doom-font (font-spec :name "Iosevka Custom" :size 17)))

So it has to be something to do with different font families.

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