emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/nlinum 05d0274 17/20: * packages/nlinum/nlinum.el (nlin


From: Stefan Monnier
Subject: [elpa] externals/nlinum 05d0274 17/20: * packages/nlinum/nlinum.el (nlinum--check-narrowing): Flush the line-number-cache as well.
Date: Sat, 28 Nov 2020 18:42:25 -0500 (EST)

branch: externals/nlinum
commit 05d02742768d02c5e2be4ab8d5d559f9f136c713
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * packages/nlinum/nlinum.el (nlinum--check-narrowing): Flush the 
line-number-cache as well.
---
 nlinum.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nlinum.el b/nlinum.el
index 99d32e7..b4066a3 100644
--- a/nlinum.el
+++ b/nlinum.el
@@ -128,8 +128,7 @@ Linum mode is a buffer-local minor mode."
     (add-hook 'after-change-functions #'nlinum--after-change nil :local)
     (add-hook 'pre-redisplay-functions #'nlinum--check-narrowing nil :local)
     (if nlinum-highlight-current-line
-        (add-hook 'post-command-hook #'nlinum--current-line-update nil :local)
-      (remove-hook 'post-command-hook #'nlinum--current-line-update :local))
+        (add-hook 'post-command-hook #'nlinum--current-line-update nil :local))
     (jit-lock-register #'nlinum--region :contextual))
   (nlinum--setup-windows))
 
@@ -294,6 +293,7 @@ Linum mode is a buffer-local minor mode."
   ;; Note: if nlinum-widen is t the flush is still needed when
   ;; point-min is/was in the middle of a line.
   (unless (eql nlinum--last-point-min (point-min))
+    (unless nlinum-widen (setq nlinum--line-number-cache nil))
     (setq nlinum--last-point-min (point-min))
     (nlinum--flush)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]