Adjust linum gutter to accomodate text-size changes

This commit is contained in:
Nathan Spaeth 2016-10-03 13:06:45 -05:00 committed by Eivind Fonn
parent 0d70306b90
commit 8eac8c4ecf
2 changed files with 11 additions and 1 deletions

View File

@ -1034,6 +1034,15 @@ is nonempty."
(when (or 'linum-mode global-linum-mode)
(linum-mode 0)))
(defun linum-update-window-scale-fix (win)
"Fix linum for scaled text in the window WIN."
(set-window-margins win
(ceiling (* (if (boundp 'text-scale-mode-step)
(expt text-scale-mode-step
text-scale-mode-amount) 1)
(if (car (window-margins))
(car (window-margins)) 1)))))
;; Generalized next-error system ("gne")

View File

@ -239,7 +239,8 @@
(spacemacs|add-toggle line-numbers
:mode linum-mode
:documentation "Show the line numbers."
:evil-leader "tn"))
:evil-leader "tn")
(advice-add #'linum-update-window :after #'linum-update-window-scale-fix))
(defun spacemacs-base/init-occur-mode ()
(evilified-state-evilify-map occur-mode-map