branch: elpa/magit
commit 495345e9aeb2be8acec6e3febd936f4c8f939355
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-diff-visit--offset: Improve function signature
---
lisp/magit-diff.el | 8 ++++----
lisp/magit-files.el | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 7c3c33fdf0..5e8d32a8f3 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1443,7 +1443,7 @@ for a revision."
(save-buffer))
(let ((buf (magit-revision-setup-buffer rev args files)))
(when file
- (let ((line (magit-diff-visit--offset file (list "-R" rev) line))
+ (let ((line (magit-diff-visit--offset line file "-R" rev))
(col (current-column)))
(with-current-buffer buf
(magit-diff--goto-file-position file line col))))))))
@@ -1816,8 +1816,8 @@ the Magit-Status buffer for DIRECTORY."
(column (magit-diff-hunk-column hunk goto-from)))
(with-current-buffer buffer
(when (and goto-file (not (equal rev "{worktree}")))
- (setq line (magit-diff-visit--offset
- file (if (equal rev "{index}") nil rev) line)))
+ (setq line (apply #'magit-diff-visit--offset line file
+ (and (equal rev "{index}") (list rev)))))
(save-restriction
(widen)
(goto-char (point-min))
@@ -1855,7 +1855,7 @@ the Magit-Status buffer for DIRECTORY."
(max 0 (- (+ (current-column) 2)
(length (oref section value))))))
-(defun magit-diff-visit--offset (file rev line)
+(defun magit-diff-visit--offset (line file &rest args)
(let ((offset 0))
(with-temp-buffer
(save-excursion
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 69552bb772..26999ea992 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -181,13 +181,13 @@ REV is a revision or one of \"{worktree}\" or
\"{index}\"."
((not (equal visited-file file)))
((magit-rev-eq rev-oid rev))
((equal rev "{worktree}")
- (setq line (magit-diff-visit--offset file rev-oid line)))
+ (setq line (magit-diff-visit--offset line file rev-oid)))
((equal rev "{index}")
- (setq line (magit-diff-visit--offset file nil line)))
+ (setq line (magit-diff-visit--offset line file)))
(rev-oid
(setq line (magit-diff-visit--offset
- file (concat rev-oid ".." rev) line)))
- ((setq line (magit-diff-visit--offset file (list "-R" rev) line)))))
+ line file (concat rev-oid ".." rev))))
+ ((setq line (magit-diff-visit--offset line file "-R" rev)))))
(with-current-buffer buf
(widen)
(goto-char (point-min))