[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff 25a7516 128/258: Only run scroll-function once
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff 25a7516 128/258: Only run scroll-function once per command |
Date: |
Wed, 17 May 2017 08:13:37 -0400 (EDT) |
branch: scratch/add-vdiff
commit 25a751611b808efc49025ab9abc2010c54eb6ba6
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Only run scroll-function once per command
Was getting into some weird display loops
---
vdiff.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 174364b..3208adf 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -182,6 +182,7 @@ because those are handled differently.")
(defvar vdiff--after-change-timer nil)
(defvar vdiff--after-change-refresh-delay 1)
(defvar vdiff--window-configuration nil)
+(defvar vdiff--new-command nil)
;; * Utilities
@@ -1004,6 +1005,9 @@ buffer)."
(set-window-vscroll window vscroll))
(force-window-update window))))))
+(defun vdiff--flag-new-command ()
+ (setq vdiff--new-command t))
+
(defun vdiff--scroll-function (&optional window window-start)
"Sync scrolling of all vdiff windows."
(let* ((window (or window (selected-window)))
@@ -1016,7 +1020,9 @@ buffer)."
(window-live-p win-a)
(window-live-p win-b)
(memq window (list win-a win-b))
- (not vdiff--in-scroll-hook))
+ (not vdiff--in-scroll-hook)
+ vdiff--new-command)
+ (setq vdiff--new-command nil)
(let* ((in-b (eq window win-b))
(other-window (if in-b win-a win-b))
(other-buffer (if in-b buf-a buf-b))
@@ -1307,8 +1313,8 @@ commands like `vdiff-files' or `vdiff-buffers'."
(cond (vdiff-mode
(setq cursor-in-non-selected-windows nil)
(add-hook 'after-save-hook #'vdiff-refresh nil t)
- (add-hook 'after-change-functions
- 'vdiff--after-change-function nil t)
+ (add-hook 'after-change-functions #'vdiff--after-change-function nil
t)
+ (add-hook 'pre-command-hook #'vdiff--flag-new-command nil t)
(when vdiff-lock-scrolling
(vdiff-scroll-lock-mode 1))
(setq vdiff--window-configuration
@@ -1317,8 +1323,8 @@ commands like `vdiff-files' or `vdiff-buffers'."
(vdiff--remove-all-overlays)
(setq cursor-in-non-selected-windows t)
(remove-hook 'after-save-hook #'vdiff-refresh t)
- (remove-hook 'after-change-functions
- 'vdiff--after-change-function 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))
(setq vdiff--diff-data nil)
- [elpa] scratch/add-vdiff f36b6b2 162/258: Fix line-translation error, (continued)
- [elpa] scratch/add-vdiff f36b6b2 162/258: Fix line-translation error, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 13f553f 163/258: Fix fold logic for diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 88e7f1c 178/258: Remove min-window-width, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 679617c 199/258: Force update of window-start on manual scroll-function, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff dcf811e 188/258: Add new on-quit options, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c82f2b5 090/258: Add docs on refinements, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 3fcf4b9 101/258: Fix sign problem in adding hunk overlays, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 9346e46 106/258: Simplify method for setting vscroll, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c46b76b 111/258: Set window point on scroll, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff fd8c973 109/258: Remove post-command-hook, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 25a7516 128/258: Only run scroll-function once per command,
Justin Burkett <=
- [elpa] scratch/add-vdiff 25ec344 134/258: Require diff-mode so that diff-mode faces are available, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 371febc 135/258: Add option to automatically refine hunks, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 9b3ffb0 150/258: Don't distiguish exit code 0 from 1, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff d33845c 167/258: Minor change in cleanup, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff edfae89 176/258: Cleanup vdiff-buffers, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 85a4d4e 087/258: Fix point jumping after sending changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f041c58 102/258: Sync lines after sending changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 88ce867 088/258: Initial attempt at refine commands, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f3ca6cb 110/258: Tweak vscroll function, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 84380fb 113/258: Delete unused lexical vars, Justin Burkett, 2017/05/17