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

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

[elpa] scratch/add-vdiff d8cfb8f 243/258: vdiff: Don't use scroll-lock-m


From: Justin Burkett
Subject: [elpa] scratch/add-vdiff d8cfb8f 243/258: vdiff: Don't use scroll-lock-mode programmatically
Date: Wed, 17 May 2017 08:14:01 -0400 (EDT)

branch: scratch/add-vdiff
commit d8cfb8fa7cbf5c5e78cbd8fd7bc6d976ce886622
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>

    vdiff: Don't use scroll-lock-mode programmatically
    
    Use the hook directly so that we control which buffers the hook is activated
    in.
---
 vdiff.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/vdiff.el b/vdiff.el
index e88c631..9761aeb 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1835,8 +1835,7 @@ you will be asked to select two files."
   (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)
-  (when vdiff-scroll-lock-mode
-    (vdiff-scroll-lock-mode -1)))
+  (remove-hook 'window-scroll-functions #'vdiff--scroll-function t))
 
 (define-minor-mode vdiff-mode
   "Minor mode active in a vdiff session involving two
@@ -1848,7 +1847,7 @@ automatically after calling commands like `vdiff-files' or
   (cond (vdiff-mode
          (vdiff--buffer-init)
          (when vdiff-lock-scrolling
-           (vdiff-scroll-lock-mode 1)))
+          (add-hook 'window-scroll-functions #'vdiff--scroll-function nil t)))
         (t
          (vdiff--buffer-cleanup))))
 
@@ -1862,7 +1861,7 @@ automatically after calling commands like `vdiff-files3' 
or
   (cond (vdiff-3way-mode
          (vdiff--buffer-init)
          (when vdiff-lock-scrolling
-           (vdiff-scroll-lock-mode 1)))
+           (add-hook 'window-scroll-functions #'vdiff--scroll-function nil t)))
         (t
          (vdiff--buffer-cleanup))))
 



reply via email to

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