emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gited aba4cf9 18/73: * gited.el (gited-goto-branch): Ch


From: Stefan Monnier
Subject: [elpa] externals/gited aba4cf9 18/73: * gited.el (gited-goto-branch): Check first that BRANCH is shown.
Date: Sun, 29 Nov 2020 00:00:31 -0500 (EST)

branch: externals/gited
commit aba4cf91306344888f125dbbb2d010c4bfee5b4c
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    * gited.el (gited-goto-branch): Check first that BRANCH is shown.
---
 gited.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/gited.el b/gited.el
index 55ba8bd..4b67b88 100644
--- a/gited.el
+++ b/gited.el
@@ -10,9 +10,9 @@
 ;; Compatibility: GNU Emacs: 24.4
 ;; Version: 0.2.0
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Thu Jun 08 14:26:38 JST 2017
+;; Last-Updated: Thu Jun 08 19:08:23 JST 2017
 ;;           By: calancha
-;;     Update #: 650
+;;     Update #: 651
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -2361,10 +2361,11 @@ Return buffer position on success, else nil."
      (list (completing-read "Jump to branch: "
                             (gited-listed-branches)
                             nil t nil nil cur-branch))))
-  (let ((row (cl-position branch (gited-listed-branches) :test #'equal)))
-    (goto-char (point-min))
-    (forward-line (if (overlays-at (point-min)) (1+ row) row))
-    (gited--goto-column (1+ gited-branch-idx))))
+  (when (gited-branch-exists-p branch)
+    (let ((row (cl-position branch (gited-listed-branches) :test #'equal)))
+      (goto-char (point-min))
+      (forward-line (if (overlays-at (point-min)) (1+ row) row))
+      (gited--goto-column (1+ gited-branch-idx)))))
 
 (defun gited-next-marked-branch (arg &optional wrap opoint)
   "Move to the next ARG marked branch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]