SOLVED
The atom-one-dark
theme that I was using was the issue.
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/atom-one-dark")
(load-theme 'atom-one-dark t)
My init.el
:
(menu-bar-mode -1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/atom-one-dark")
(load-theme 'atom-one-dark t)
(custom-set-faces
'(mode-line ((t (:box (:line-width 8 :color "#21252B")))))
'(mode-line-inactive ((t (:box (:line-width 8 :color "#181A1F"))))))
I am new to Emacs, I've set up display-line-numbers-mode
like so:
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
This enables display-line-numbers-mode
on all source code files (ex: .py, .js), and it works fine.
Now, my problem is that the font size is always constant, meaning that when I zoom in, this happens:
And when I zoom out:
Doom Emacs
Surprisingly enough, Doom Emacs uses display-line-numbers-mode
, and has managed to fix this issue, I don't know how they did it:
Zoom Out:
Zoom In:
I don't exactly know how they managed to fix it, I found some of their code here
Why Did I Ask?
I am having this issue, and I didn't found anything regarding this issue on the Internet. Google (Startpage) is giving me irrelevant results, ex. linum-mode
How You Can Answer This Question
Do's:
- Correct any misinformation (comment), example: Doom Emacs doesn't use
display-line-numbers-mode
- Solve my issue (answer), please write
elisp
code blocks in the answer since I am new. - Refer to websites or answers that you think is helpful (comment or answer).
- Show me how you did it in your config (answer)
Dont's:
- Don't refer to
linum-mode
, I've already tried it, and it has many issues. + Doom Emacs did it right, despite them usingdisplay-line-numbers-mode
.