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

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

[elpa] master ef899b8 46/57: Reset truncate-lines on cleanup


From: Justin Burkett
Subject: [elpa] master ef899b8 46/57: Reset truncate-lines on cleanup
Date: Tue, 3 Nov 2020 14:32:25 -0500 (EST)

branch: master
commit ef899b82c4df6276306f1a92d6fc5530a82690b4
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>

    Reset truncate-lines on cleanup
    
    See #21
---
 vdiff.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/vdiff.el b/vdiff.el
index 17011fb..226c3ab 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -231,6 +231,7 @@ because those are handled differently.")
 (defvar vdiff--inhibit-window-switch nil)
 (defvar vdiff--inhibit-diff-update nil)
 (defvar vdiff--in-scroll-hook nil)
+(defvar vdiff--cleanup-hook nil)
 ;; (defvar vdiff--in-post-command-hook nil)
 (defvar vdiff--setting-vscroll nil)
 (defvar vdiff--after-change-timer nil)
@@ -2218,8 +2219,10 @@ See README for entry points into a vdiff session."))
           (current-window-configuration))
     (when vdiff-lock-scrolling
       (add-hook 'window-scroll-functions #'vdiff--scroll-function nil t))
-    (when vdiff-truncate-lines
+    (when (and vdiff-truncate-lines (null truncate-lines))
       (let (message-log-max)
+        (add-hook 'vdiff--cleanup-hook
+                  (lambda () (toggle-truncate-lines 0)) nil t)
         (toggle-truncate-lines 1)))))
 
 (defun vdiff--buffer-cleanup ()
@@ -2229,7 +2232,8 @@ See README for entry points into a vdiff session."))
     (remove-hook 'after-save-hook #'vdiff-refresh t)
     (remove-hook 'after-change-functions #'vdiff--after-change-function t)
     (remove-hook 'pre-command-hook #'vdiff--flag-new-command t))
-  (remove-hook 'window-scroll-functions #'vdiff--scroll-function t))
+  (remove-hook 'window-scroll-functions #'vdiff--scroll-function t)
+  (run-hooks 'vdiff--cleanup-hook))
 
 (define-minor-mode vdiff-mode
   "Minor mode active in a vdiff session involving two



reply via email to

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