Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Sep 23, 2016
1 parent 6ccb562 commit f420ea0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lisp/init-git.el
Expand Up @@ -146,6 +146,18 @@
(forward-line -1)
(git-gutter:next-hunk arg))))

(defun my-goto-previous-hunk (arg)
(interactive "p")
(if (memq major-mode '(diff-mode))
(diff-hunk-prev)
(forward-line -1)
(if (re-search-backward "\\(^>>>>>>>\\|^=======\\|^<<<<<<<\\)" (point-min) t)
(goto-char (line-beginning-position))
(forward-line -1)
(git-gutter:previous-hunk arg))))
;; }}

;; {{ git-gutter use ivy
(defun my-reshape-git-gutter (gutter)
"Re-shape gutter for `ivy-read'."
(let* ((linenum-start (aref gutter 3))
Expand Down Expand Up @@ -182,15 +194,6 @@
(goto-line e)))
(message "NO git-gutters!")))

(defun my-goto-previous-hunk (arg)
(interactive "p")
(if (memq major-mode '(diff-mode))
(diff-hunk-prev)
(forward-line -1)
(if (re-search-backward "\\(^>>>>>>>\\|^=======\\|^<<<<<<<\\)" (point-min) t)
(goto-char (line-beginning-position))
(forward-line -1)
(git-gutter:previous-hunk arg))))
;; }}

;; {{ git-messenger
Expand Down

0 comments on commit f420ea0

Please sign in to comment.