瀏覽代碼

add text size fix for linum

Josh Bicking 7 年之前
父節點
當前提交
e8d62c9374
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      emacs.d/packages/packages.el

+ 11 - 1
emacs.d/packages/packages.el

@@ -214,7 +214,17 @@
   :config
   (setq linum-relative-current-symbol "")
   (linum-mode)
-  (linum-relative-global-mode))
+  (linum-relative-global-mode)
+  (defun linum-update-window-scale-fix (win)
+  "fix linum for scaled text"
+  (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)
+              ))))
+  (advice-add #'linum-update-window :after #'linum-update-window-scale-fix))
 
 
 (use-package flymd