branch: elpa/magit
commit 42fcdf4daa812a76c430e36cefa1a094ceb48465
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-diff--goto-file-position: Renamed function
---
lisp/magit-diff.el | 6 +++---
lisp/magit-status.el | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index f8e743158a5..4901d0d49d0 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1369,7 +1369,7 @@ the file or blob."
(list file)
'unstaged
magit-diff-buffer-file-locked)
- (magit-diff--goto-position file line col))))
+ (magit-diff--goto-file-position file line col))))
(user-error "Buffer isn't visiting a file")))
;;;###autoload
@@ -1426,7 +1426,7 @@ for a revision."
(let ((line (magit-diff-visit--offset file (list "-R" rev) line))
(col (current-column)))
(with-current-buffer buf
- (magit-diff--goto-position file line col))))))))
+ (magit-diff--goto-file-position file line col))))))))
(defun magit-diff--locate-hunk (file line &optional parent)
(and-let* ((diff (cl-find-if (##and (cl-typep % 'magit-file-section)
@@ -1442,7 +1442,7 @@ for a revision."
((<= beg line end) (cl-return (list hunk t)))
((null hunks) (cl-return (list hunk nil)))))))))))
-(defun magit-diff--goto-position (file line column &optional parent)
+(defun magit-diff--goto-file-position (file line column &optional parent)
(when-let ((pos (magit-diff--locate-hunk file line parent)))
(pcase-let ((`(,section ,exact) pos))
(cond ((cl-typep section 'magit-file-section)
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 2b806305e34..14e80e61b5f 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -463,12 +463,13 @@ Type \\[magit-commit] to create a commit.
(let ((staged (magit-get-section '((staged) (status)))))
(if (and staged
(cadr (magit-diff--locate-hunk file line staged)))
- (magit-diff--goto-position file line col staged)
+ (magit-diff--goto-file-position file line col staged)
(let ((unstaged (magit-get-section '((unstaged) (status)))))
(unless (and unstaged
- (magit-diff--goto-position file line col
unstaged))
+ (magit-diff--goto-file-position
+ file line col unstaged))
(when staged
- (magit-diff--goto-position file line col staged))))))))
+ (magit-diff--goto-file-position file line col
staged))))))))
buf)))
(defun magit-status-refresh-buffer ()