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 ()
|
(defun magit-wash-diff ()
|
||||||
(cond ((looking-at "^diff")
|
(cond ((looking-at "^diff")
|
||||||
(magit-with-section (magit-current-line) 'diff
|
(magit-with-section (magit-current-line) 'diff
|
||||||
(let ((file (magit-diff-line-file)))
|
(let ((file (magit-diff-line-file))
|
||||||
;; XXX - figure out real status and propertize
|
(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)
|
(magit-set-section-info file)
|
||||||
(insert "\tModified " file "\n"))
|
(let ((status (cond
|
||||||
(forward-line) ;; skip over "diff" line
|
((save-excursion
|
||||||
(cond ((search-forward-regexp "^diff\\|^@@" nil t)
|
(search-forward-regexp "^new" end t))
|
||||||
(goto-char (match-beginning 0))
|
"New ")
|
||||||
(magit-wash-sequence #'magit-wash-hunk))
|
(t
|
||||||
(t
|
"Modified"))))
|
||||||
(goto-char (point-max)))))
|
(insert "\t" status " " file "\n")
|
||||||
t)
|
(goto-char end)
|
||||||
|
(magit-wash-sequence #'magit-wash-hunk)
|
||||||
|
t))))
|
||||||
(t
|
(t
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue