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

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

[elpa] master f92a1c6: * packages/nlinum/nlinum.el (nlinum--flush): Wide


From: Stefan Monnier
Subject: [elpa] master f92a1c6: * packages/nlinum/nlinum.el (nlinum--flush): Widen to really flush all.
Date: Tue, 26 Mar 2019 11:40:54 -0400 (EDT)

branch: master
commit f92a1c600ebf6d917a64ae93a93ba469cd37ddd3
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * packages/nlinum/nlinum.el (nlinum--flush): Widen to really flush all.
---
 packages/nlinum/nlinum.el | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/packages/nlinum/nlinum.el b/packages/nlinum/nlinum.el
index 4a726c7..4f0e02f 100644
--- a/packages/nlinum/nlinum.el
+++ b/packages/nlinum/nlinum.el
@@ -110,6 +110,7 @@ Linum mode is a buffer-local minor mode."
   (remove-hook 'post-command-hook #'nlinum--current-line-update :local)
   (remove-hook 'pre-redisplay-functions #'nlinum--check-narrowing :local)
   (kill-local-variable 'nlinum--line-number-cache)
+  (kill-local-variable 'nlinum--last-point-min)
   (remove-overlays (point-min) (point-max) 'nlinum t)
   ;; (kill-local-variable 'nlinum--ol-counter)
   (kill-local-variable 'nlinum--width)
@@ -185,17 +186,23 @@ Linum mode is a buffer-local minor mode."
 
 (defun nlinum--flush ()
   (nlinum--setup-windows)
-  ;; (kill-local-variable 'nlinum--ol-counter)
-  (remove-overlays (point-min) (point-max) 'nlinum t)
-  (run-with-timer 0 nil
-                  (lambda (buf)
-                    (with-current-buffer buf
-                      (with-silent-modifications
-                        ;; FIXME: only remove `fontified' on those parts of the
-                        ;; buffer that had an nlinum overlay!
-                        (remove-text-properties
-                         (point-min) (point-max) '(fontified)))))
-                  (current-buffer)))
+  (save-excursion
+    (save-restriction
+      (widen)
+      ;; (kill-local-variable 'nlinum--ol-counter)
+      (remove-overlays (point-min) (point-max) 'nlinum t)
+      (run-with-timer 0 nil
+                      (lambda (buf)
+                        (with-current-buffer buf
+                          (with-silent-modifications
+                            ;; FIXME: only remove `fontified' on those parts of
+                            ;; the buffer that had an nlinum overlay!
+                            (save-excursion
+                              (save-restriction
+                                (widen)
+                                (remove-text-properties
+                                 (point-min) (point-max) '(fontified)))))))
+                      (current-buffer)))))
 
 (defun nlinum--current-line-update ()
   "Update current line number."



reply via email to

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