[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff cd9dad4 191/258: Fix refresh function call sequ
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff cd9dad4 191/258: Fix refresh function call sequence |
Date: |
Wed, 17 May 2017 08:13:48 -0400 (EDT) |
branch: scratch/add-vdiff
commit cd9dad4ed98ebb54e9d199b299bee290ceb71664
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Fix refresh function call sequence
refresh is asynchronous, so make sure that the scroll functions are
called after the refresh finishes
---
vdiff.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 9de8091..97ae844 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -426,7 +426,7 @@ because those are handled differently.")
;; * Main overlay refresh routine
-(defun vdiff-refresh ()
+(defun vdiff-refresh (&optional post-refresh-hook)
"Asynchronously refresh diff information."
(interactive)
(when (vdiff--buffer-p)
@@ -470,6 +470,7 @@ because those are handled differently.")
(process-put proc 'vdiff-session ses)
(process-put proc 'vdiff-tmp-a tmp-a)
(process-put proc 'vdiff-tmp-b tmp-b)
+ (process-put proc 'vdiff-post-refresh-hook post-refresh-hook)
(when tmp-c
(process-put proc 'vdiff-tmp-c tmp-c))
(set-process-sentinel proc #'vdiff--diff-refresh-1))))
@@ -568,7 +569,8 @@ parsing the diff output and triggering the overlay updates."
(when (process-get proc 'vdiff-tmp-c)
(delete-file (process-get proc 'vdiff-tmp-c)))
(when vdiff-auto-refine
- (vdiff-refine-all-hunks)))
+ (vdiff-refine-all-hunks))
+ (run-hooks (process-get proc 'vdiff-post-refresh-hook)))
(setf (vdiff-session-diff-stale ses) nil))))
(defun vdiff--remove-all-overlays ()
@@ -1100,8 +1102,7 @@ use the hunk under point or on the immediately preceding
line."
((eq (overlay-get ovr 'vdiff-type) 'subtraction)
(vdiff--transmit-subtraction ovr targets))))
(unless dont-refresh
- (vdiff-refresh)
- (vdiff--scroll-function))))
+ (vdiff-refresh #'vdiff--scroll-function))))
(defun vdiff-receive-changes (beg end)
"Receive the changes corresponding to this position from
@@ -1610,8 +1611,7 @@ function for ON-QUIT to do something useful with the
result."
(vdiff-mode -1)
(vdiff-3way-mode -1)
(vdiff-mode 1)))
- (vdiff-refresh)
- (vdiff-sync-and-center)))
+ (vdiff-refresh #'vdiff-sync-and-center)))
(defcustom vdiff-3way-layout-function 'vdiff-3way-layout-function-default
"Function to layout windows in 3way diffs"
@@ -1667,8 +1667,7 @@ function for ON-QUIT to do something useful with the
result."
(vdiff-mode -1)
(vdiff-3way-mode -1)
(vdiff-3way-mode 1)))
- (vdiff-refresh)
- (vdiff-sync-and-center)))
+ (vdiff-refresh #'vdiff-sync-and-center)))
;;;###autoload
(defun vdiff-files3 (file-a file-b file-c &optional on-quit)
- [elpa] scratch/add-vdiff bd80900 126/258: Merge pull request #7 from syohex/fix-package, (continued)
- [elpa] scratch/add-vdiff bd80900 126/258: Merge pull request #7 from syohex/fix-package, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 1102da8 129/258: Avoid subtraction overlays larger than window-height, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7135738 132/258: Version 0.1, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 2e7f076 141/258: Simplify bitmap creation, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 001ae43 152/258: Fix modification of buffer list, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 477eb88 161/258: Fix refinement bug, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f1eca80 165/258: Disable refine-all-hunks for diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 30b85fe 164/258: Fix sending changes with diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 816fe2a 182/258: Fix subtraction string width, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 582d13d 180/258: Fix compiler warnings, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff cd9dad4 191/258: Fix refresh function call sequence,
Justin Burkett <=
- [elpa] scratch/add-vdiff 2847cd6 183/258: Add callback support on quit, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 90f81f0 175/258: Make sure hook functions execute in vdiff bufs, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 2d48cb5 229/258: vdiff-magit: Simplify resolve, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c31755a 220/258: vdiff-magit: Port show stash, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff cfb90d7 233/258: vdiff-magit: Add note to README, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f5fdcaa 241/258: vdiff-magit: Simplify exit from stage, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff e8d3d26 236/258: vdiff-magit: Try to switch resolve functions gracefully, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7c87360 244/258: vdiff: Add vdiff-current-file, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8b32329 245/258: vdiff: Filter out killed buffers better, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8aa5c45 250/258: vdiff-magit: Fix paren, Justin Burkett, 2017/05/17