branch: master commit c732247f19c56caa32e679633a0d7ae158aab56c Author: Justin Burkett <jus...@burkett.cc> Commit: Justin Burkett <jus...@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 2c6085d..a6a3130 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) @@ -2281,8 +2282,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 () @@ -2292,7 +2295,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