branch: scratch/add-vdiff
commit af5ddce08f9d98578a94245ed50ef41e5996a99f
Author: justbur <[email protected]>
Commit: justbur <[email protected]>
Remove vdiff-sync-and-center
recenter serves this purpose fine now, since the scroll function picks
up any scrolling changes properly.
---
README.org | 5 ++---
vdiff.el | 35 ++++++++---------------------------
2 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/README.org b/README.org
index 6768c2a..9b887bf 100644
--- a/README.org
+++ b/README.org
@@ -22,8 +22,8 @@ buffer to the other. The main features are
vdiff has not been extensively tested yet, so please report any issues you
find. Contributions and suggestions are very welcome.
-** Recent Changes
- - [2016-07-25] Added three-way diff support. See =vdiff-buffers3= and
=vdiff-files3=.
+** Recent (Significant) Changes
+ - [2016-07-25] Added three-way diff support. See =vdiff-buffers3= and
=vdiff-files3=.
** Screenshot
@@ -58,7 +58,6 @@ the commands would be
| =C-c n= | =vdiff-next-hunk= | Move to next hunk in buffer |
| =C-c p= | =vdiff-previous-hunk= | Move to previous hunk in buffer |
| =C-c h= | =vdiff-hydra/body= | Enter vdiff-hydra |
-| =C-l= | =vdiff-sync-and-center= | Recenter both buffers at this line |
*** Viewing and Transmitting Changes Between Buffers
diff --git a/vdiff.el b/vdiff.el
index 1ca4de3..58ca0b9 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1325,18 +1325,6 @@ the current one."
(when line
(vdiff--move-to-line line))))
-(defun vdiff--recenter-all ()
- (dolist (win (vdiff--all-windows))
- (with-selected-window win
- (recenter))))
-
-(defun vdiff-sync-and-center ()
- "Sync point in another vdiff buffers to the line in this
-buffer and recenter all buffers."
- (interactive)
- (vdiff--scroll-function)
- (vdiff--recenter-all))
-
(defun vdiff-restore-windows ()
"Restore initial window configuration."
(interactive)
@@ -1560,28 +1548,28 @@ with non-nil USE-FOLDS."
(interactive "p")
(let ((count (or arg 1)))
(goto-char (vdiff--nth-hunk count))
- (vdiff-sync-and-center)))
+ (recenter)))
(defun vdiff-previous-hunk (arg)
"Jump to previous change in this buffer."
(interactive "p")
(let ((count (or (- arg) -1)))
(goto-char (vdiff--nth-hunk count))
- (vdiff-sync-and-center)))
+ (recenter)))
(defun vdiff-next-fold (arg)
"Jump to next fold in this buffer."
(interactive "p")
(let ((count (or arg 1)))
(goto-char (vdiff--nth-hunk count t))
- (vdiff-sync-and-center)))
+ (recenter)))
(defun vdiff-previous-fold (arg)
"Jump to previous fold in this buffer."
(interactive "p")
(let ((count (or (- arg) -1)))
(goto-char (vdiff--nth-hunk count t))
- (vdiff-sync-and-center)))
+ (recenter)))
;; * Session
@@ -1669,7 +1657,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--scroll-function)))
(defcustom vdiff-3way-layout-function 'vdiff-3way-layout-function-default
"Function to layout windows in 3way diffs"
@@ -1725,7 +1713,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--scroll-function)))
;;;###autoload
(defun vdiff-files3 (file-a file-b file-c &optional on-quit)
@@ -1782,16 +1770,9 @@ you will be asked to select two files."
(setq vdiff--session nil)
(message "vdiff exited")))
-(defvar vdiff-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-l" 'vdiff-sync-and-center)
- map))
+(defvar vdiff-mode-map (make-sparse-keymap))
-(defvar vdiff-3way-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map vdiff-mode-map)
- (define-key map "\C-l" 'vdiff-sync-and-center)
- map))
+(defvar vdiff-3way-mode-map (make-sparse-keymap))
(defvar vdiff-mode-prefix-map
(let ((map (make-sparse-keymap)))