branch: scratch/add-vdiff
commit 8a51468ec95e92ae3d0532d97a214cd74354e4ee
Author: justbur <[email protected]>
Commit: justbur <[email protected]>
Don't close fold on point on refresh
---
vdiff.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/vdiff.el b/vdiff.el
index 8d7afbe..776c429 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -399,7 +399,15 @@ lines hidden."
(overlay-put a-fold 'vdiff-other-fold b-fold)
(overlay-put b-fold 'display (overlay-get b-fold 'vdiff-fold-text))
(overlay-put b-fold 'vdiff-fold-open nil)
- (overlay-put b-fold 'vdiff-other-fold a-fold))))
+ (overlay-put b-fold 'vdiff-other-fold a-fold)
+ (when (and (eq (current-buffer) a-buffer)
+ (>= (point) (overlay-start a-fold))
+ (<= (point) (overlay-end a-fold)))
+ (vdiff-open-fold (point) (1+ (point))))
+ (when (and (eq (current-buffer) b-buffer)
+ (>= (point) (overlay-start b-fold))
+ (<= (point) (overlay-end b-fold)))
+ (vdiff-open-fold (point) (1+ (point)))))))
(defun vdiff--refresh-overlays ()
(vdiff--remove-all-overlays)