branch: scratch/add-vdiff
commit 74ebab657e146d95ca644b5f797fc5f47fafcc4c
Author: justbur <[email protected]>
Commit: justbur <[email protected]>
Don't move point when closing all folds
---
vdiff.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index d9e2d69..4bf3813 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1204,14 +1204,16 @@ folds in the region."
(defun vdiff-open-all-folds ()
"Open all folds in both buffers"
(interactive)
- (setq vdiff--all-folds-open t)
- (vdiff-open-fold (point-min) (point-max)))
+ (save-excursion
+ (setq vdiff--all-folds-open t)
+ (vdiff-open-fold (point-min) (point-max))))
(defun vdiff-close-all-folds ()
"Close all folds in both buffers"
(interactive)
- (setq vdiff--all-folds-open nil)
- (vdiff-close-fold (point-min) (point-max)))
+ (save-excursion
+ (setq vdiff--all-folds-open nil)
+ (vdiff-close-fold (point-min) (point-max))))
(defun vdiff-close-other-folds ()
"Close all other folds in both buffers"