Better file status indication.
* magit.el (magit-wash-diff): Grep diff header for status of file.
This commit is contained in:
parent
8ca446c4bd
commit
a379bb1e0f
1 changed files with 18 additions and 10 deletions
28
magit.el
28
magit.el
|
@ -849,17 +849,25 @@ Please see the manual for a complete description of Magit.
|
|||
(defun magit-wash-diff ()
|
||||
(cond ((looking-at "^diff")
|
||||
(magit-with-section (magit-current-line) 'diff
|
||||
(let ((file (magit-diff-line-file)))
|
||||
;; XXX - figure out real status and propertize
|
||||
(let ((file (magit-diff-line-file))
|
||||
(end (save-excursion
|
||||
(forward-line) ;; skip over "diff" line
|
||||
(if (search-forward-regexp "^diff\\|^@@" nil t)
|
||||
(goto-char (match-beginning 0))
|
||||
(goto-char (point-max)))
|
||||
(point-marker))))
|
||||
;; XXX - figure out real status and propertize
|
||||
(magit-set-section-info file)
|
||||
(insert "\tModified " file "\n"))
|
||||
(forward-line) ;; skip over "diff" line
|
||||
(cond ((search-forward-regexp "^diff\\|^@@" nil t)
|
||||
(goto-char (match-beginning 0))
|
||||
(magit-wash-sequence #'magit-wash-hunk))
|
||||
(t
|
||||
(goto-char (point-max)))))
|
||||
t)
|
||||
(let ((status (cond
|
||||
((save-excursion
|
||||
(search-forward-regexp "^new" end t))
|
||||
"New ")
|
||||
(t
|
||||
"Modified"))))
|
||||
(insert "\t" status " " file "\n")
|
||||
(goto-char end)
|
||||
(magit-wash-sequence #'magit-wash-hunk)
|
||||
t))))
|
||||
(t
|
||||
nil)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue