From b5486e780e4301ade8dbda70cd1663c1dbc87f67 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 7 Apr 2017 20:04:21 -0400 Subject: [PATCH] core-ui: fix nlinum overlays after font changes --- core/core-ui.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core-ui.el b/core/core-ui.el index 03b29641b..1b017cec6 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -186,6 +186,13 @@ file." 'nlinum-mode) :config + (defun doom*nlinum-flush (&rest _) + "Fix nlinum margins after a change in font." + (dolist (buffer (doom-visible-buffers)) + (with-current-buffer buffer + (when nlinum-mode (nlinum--flush))))) + (advice-add 'set-frame-font :after 'doom*nlinum-flush) + ;; Optimization: calculate line number column width beforehand (add-hook! nlinum-mode (setq nlinum--width (length (save-excursion (goto-char (point-max))