[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff fd8c973 109/258: Remove post-command-hook
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff fd8c973 109/258: Remove post-command-hook |
Date: |
Wed, 17 May 2017 08:13:33 -0400 (EDT) |
branch: scratch/add-vdiff
commit fd8c9739bac2012b3d8e52ff353090d945d62a5b
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Remove post-command-hook
---
vdiff.el | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 32c5131..6a7f74d 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -173,7 +173,7 @@ because those are handled differently.")
"^\\([0-9]+\\),?\\([0-9]+\\)?\\([adc]\\)\\([0-9]+\\),?\\([0-9]+\\)?")
(defvar vdiff--inhibit-window-switch nil)
(defvar vdiff--in-scroll-hook nil)
-(defvar vdiff--in-post-command-hook nil)
+;; (defvar vdiff--in-post-command-hook nil)
(defvar vdiff--a-b-line-map nil)
(defvar vdiff--b-a-line-map nil)
(defvar vdiff--folds nil)
@@ -1018,19 +1018,21 @@ buffer)."
other-rel-line)
(unless (= other-curr-start other-start-pos)
(set-window-start other-window other-start-pos))
- (vdiff--set-vscroll (vdiff--other-window) scroll-amt)))))
-
-(defun vdiff--post-command-hook ()
- "Sync scroll for `vdiff--force-sync-commands'."
- ;; Use real-this-command because evil-next-line and evil-previous-line
pretend
- ;; they are next-line and previous-line
- (when (and (memq this-command vdiff--force-sync-commands)
- (not vdiff--in-post-command-hook)
- (vdiff--buffer-p))
- (let ((vdiff--in-post-command-hook t))
- (when (and (sit-for 0.05)
- (eq vdiff-subtraction-style 'full))
- (vdiff--scroll-function)))))
+ (when (eq vdiff-subtraction-style 'full)
+ (vdiff--set-vscroll (vdiff--other-window) scroll-amt))))))
+
+;; (defun vdiff--post-command-hook ()
+;; "Sync scroll for `vdiff--force-sync-commands'."
+;; ;; Use real-this-command because evil-next-line and evil-previous-line
pretend
+;; ;; they are next-line and previous-line
+;; (when (and (memq this-command vdiff--force-sync-commands)
+;; (not vdiff--in-post-command-hook)
+;; (vdiff--buffer-p))
+;; (let ((vdiff--in-post-command-hook t))
+;; (when (and (sit-for 0.05)
+;; (eq vdiff-subtraction-style 'full))
+;; (vdiff--scroll-function)))))
+
(defun vdiff--after-change-function (beg _end _len)
(unless vdiff--diff-stale
(setq vdiff--diff-stale t)
@@ -1332,13 +1334,11 @@ enabled automatically if `vdiff-lock-scrolling' is
non-nil."
(unless vdiff-mode
(vdiff-mode 1))
(vdiff--with-all-buffers
- (add-hook 'window-scroll-functions #'vdiff--scroll-function nil t)
- (add-hook 'post-command-hook #'vdiff--post-command-hook nil t))
+ (add-hook 'window-scroll-functions #'vdiff--scroll-function nil t))
(message "Scrolling locked"))
(t
(vdiff--with-all-buffers
- (remove-hook 'window-scroll-functions #'vdiff--scroll-function t)
- (remove-hook 'post-command-hook #'vdiff--post-command-hook t))
+ (remove-hook 'window-scroll-functions #'vdiff--scroll-function t))
(message "Scrolling unlocked"))))
(defun vdiff--define-hydra ()
- [elpa] scratch/add-vdiff e556705 151/258: Simplify scroll function, (continued)
- [elpa] scratch/add-vdiff e556705 151/258: Simplify scroll function, Justin Burkett, 2017/05/17
- [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 <=
- [elpa] scratch/add-vdiff 25a7516 128/258: Only run scroll-function once per command, Justin Burkett, 2017/05/17
- [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