From 384b775ace7cb0d1d8ff92aae6af4691b226ffd0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 24 May 2016 22:50:39 -0400 Subject: [PATCH] Fix linum bug when making new frames --- core/core-ui.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index afaf5485e..e345fe81a 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -156,9 +156,14 @@ (add-hook! 'nlinum-mode-hook (add-hook 'post-command-hook 'doom|nlinum-hl-line nil t)) :config + ;; Calculate line number column width (add-hook! nlinum-mode (setq nlinum--width (length (save-excursion (goto-char (point-max)) - (format-mode-line "%l")))))) + (format-mode-line "%l"))))) + ;; Disable nlinum when making frames, otherwise we get linum face error + ;; messages that prevent frame creation. + (add-hook 'before-make-frame-hook 'doom|nlinum-disable) + (add-hook 'after-make-frame-functions 'doom|nlinum-enable)) ;;