update packages
This commit is contained in:
@@ -346,12 +346,12 @@ that many spaces. Otherwise, highlight neither."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom magit-diff-extra-stat-arguments nil
|
||||
"Additional arguments to be used alongside `--stat'.
|
||||
"Additional arguments to be used alongside \"--stat\".
|
||||
|
||||
A list of zero or more arguments or a function that takes no
|
||||
argument and returns such a list. These arguments are allowed
|
||||
here: `--stat-width', `--stat-name-width', `--stat-graph-width'
|
||||
and `--compact-summary'. See the git-diff(1) manpage."
|
||||
here: \"--stat-width\", \"--stat-name-width\", \"--stat-graph-width\"
|
||||
and \"--compact-summary\". See the git-diff(1) manpage."
|
||||
:package-version '(magit . "3.0.0")
|
||||
:group 'magit-diff
|
||||
:type `(radio (function-item ,#'magit-diff-use-window-width-as-stat-width)
|
||||
@@ -439,7 +439,7 @@ CommitDate: %cd
|
||||
|
||||
All headers in revision buffers are inserted by the section
|
||||
inserter `magit-insert-revision-headers'. Some of the headers
|
||||
are created by calling `git show --format=FORMAT' where FORMAT
|
||||
are created by calling \"git show --format=FORMAT\" where FORMAT
|
||||
is the format specified here. Other headers are hard coded or
|
||||
subject to option `magit-revision-insert-related-refs'."
|
||||
:package-version '(magit . "2.3.0")
|
||||
@@ -1136,12 +1136,11 @@ and `:slant'."
|
||||
:multi-value t)
|
||||
|
||||
(defun magit-read-files (prompt initial-input history &optional list-fn)
|
||||
(magit-with-toplevel
|
||||
(magit-completing-read-multiple prompt
|
||||
(funcall (or list-fn #'magit-list-files))
|
||||
nil nil
|
||||
(or initial-input (magit-file-at-point))
|
||||
history)))
|
||||
(magit-completing-read-multiple prompt
|
||||
(funcall (or list-fn #'magit-list-files))
|
||||
nil nil
|
||||
(or initial-input (magit-file-at-point))
|
||||
history))
|
||||
|
||||
(transient-define-argument magit-diff:-U ()
|
||||
:description "Context lines"
|
||||
@@ -1403,11 +1402,11 @@ If no DWIM context is found, nil is returned."
|
||||
((string= (magit-rev-parse revB) base)
|
||||
(format "%s..%s" revB revA))
|
||||
(interactive
|
||||
(let ((main (magit-completing-read "View changes along"
|
||||
(list revA revB)
|
||||
nil t nil nil revB)))
|
||||
(format "%s...%s"
|
||||
(if (string= main revB) revA revB) main)))
|
||||
(let ((main (magit-completing-read "View changes along"
|
||||
(list revA revB)
|
||||
nil t nil nil revB)))
|
||||
(format "%s...%s"
|
||||
(if (string= main revB) revA revB) main)))
|
||||
((format "%s...%s" revA revB))))
|
||||
(format "%s..%s" revA revB)))))
|
||||
|
||||
@@ -1605,7 +1604,7 @@ for a revision."
|
||||
(while (or (< l line)
|
||||
(= (char-after) ?-))
|
||||
(unless (= (char-after) ?-)
|
||||
(cl-incf l))
|
||||
(incf l))
|
||||
(forward-line)))
|
||||
(setq found (if (= (char-after) ?+) 'line 'hunk))
|
||||
(forward-char (1+ column))
|
||||
@@ -1995,7 +1994,7 @@ the Magit-Status buffer for DIRECTORY."
|
||||
(unless (string-search
|
||||
(if goto-from "+" "-")
|
||||
(buffer-substring (point) (+ (point) prefix)))
|
||||
(cl-incf offset))
|
||||
(incf offset))
|
||||
(forward-line))
|
||||
offset))))))
|
||||
|
||||
@@ -2026,13 +2025,13 @@ the Magit-Status buffer for DIRECTORY."
|
||||
( to-len (string-to-number (match-str 4))))
|
||||
(if (<= from-beg line)
|
||||
(if (< (+ from-beg from-len) line)
|
||||
(cl-incf offset (- to-len from-len))
|
||||
(incf offset (- to-len from-len))
|
||||
(let ((rest (- line from-beg)))
|
||||
(while (> rest 0)
|
||||
(pcase (char-after)
|
||||
(?\s (cl-decf rest))
|
||||
(?- (cl-decf offset) (cl-decf rest))
|
||||
(?+ (cl-incf offset)))
|
||||
(?\s (decf rest))
|
||||
(?- (decf offset) (decf rest))
|
||||
(?+ (incf offset)))
|
||||
(forward-line))))
|
||||
(throw 'found nil))))))
|
||||
(+ line offset)))
|
||||
@@ -2103,10 +2102,10 @@ the Magit-Status buffer for DIRECTORY."
|
||||
(while (and (not (eobp))
|
||||
(memq (char-after) '(?\s ?- ?+)))
|
||||
(pcase (char-after)
|
||||
(?\s (cl-incf -line)
|
||||
(cl-incf +line))
|
||||
(?- (push (cl-incf -line) -lines))
|
||||
(?+ (push (cl-incf +line) +lines)))
|
||||
(?\s (incf -line)
|
||||
(incf +line))
|
||||
(?- (push (incf -line) -lines))
|
||||
(?+ (push (incf +line) +lines)))
|
||||
(forward-line))))
|
||||
(list (nreverse -lines)
|
||||
(nreverse +lines))))
|
||||
@@ -2193,30 +2192,32 @@ commit or stash at point, then prompt for a commit."
|
||||
(defun magit-section-cycle-diffs ()
|
||||
"Cycle visibility of diff-related sections in the current buffer."
|
||||
(interactive)
|
||||
(when-let ((sections
|
||||
(cond ((derived-mode-p 'magit-status-mode)
|
||||
(mapcan (lambda (section)
|
||||
(and section
|
||||
(progn
|
||||
(when (oref section hidden)
|
||||
(magit-section-show section))
|
||||
(oref section children))))
|
||||
(list (magit-get-section '((staged) (status)))
|
||||
(magit-get-section '((unstaged) (status))))))
|
||||
((derived-mode-p 'magit-diff-mode)
|
||||
(seq-filter #'magit-file-section-p
|
||||
(oref magit-root-section children))))))
|
||||
(if (seq-some (##oref % hidden) sections)
|
||||
(dolist (s sections)
|
||||
(magit-section-show s)
|
||||
(magit-section-hide-children s))
|
||||
(let ((children (mapcan (##copy-sequence (oref % children)) sections)))
|
||||
(cond ((and (seq-some (##oref % hidden) children)
|
||||
(seq-some (##oref % children) children))
|
||||
(mapc #'magit-section-show-headings sections))
|
||||
((seq-some #'magit-section-hidden-body children)
|
||||
(mapc #'magit-section-show-children sections))
|
||||
((mapc #'magit-section-hide sections)))))))
|
||||
(cond-let*
|
||||
[[sections
|
||||
(cond ((derived-mode-p 'magit-status-mode)
|
||||
(mapcan (lambda (section)
|
||||
(and section
|
||||
(progn
|
||||
(when (oref section hidden)
|
||||
(magit-section-show section))
|
||||
(copy-sequence (oref section children)))))
|
||||
(list (magit-get-section '((staged) (status)))
|
||||
(magit-get-section '((unstaged) (status))))))
|
||||
((derived-mode-p 'magit-diff-mode)
|
||||
(seq-filter #'magit-file-section-p
|
||||
(oref magit-root-section children))))]]
|
||||
((not sections))
|
||||
((seq-some (##oref % hidden) sections)
|
||||
(dolist (s sections)
|
||||
(magit-section-show s)
|
||||
(magit-section-hide-children s)))
|
||||
[[children (mapcan (##copy-sequence (oref % children)) sections)]]
|
||||
((and (seq-some (##oref % hidden) children)
|
||||
(seq-some (##oref % children) children))
|
||||
(mapc #'magit-section-show-headings sections))
|
||||
((seq-some #'magit-section-hidden-body children)
|
||||
(mapc #'magit-section-show-children sections))
|
||||
((mapc #'magit-section-hide sections))))
|
||||
|
||||
;;;; Jump Commands
|
||||
|
||||
@@ -2505,7 +2506,7 @@ keymap is the parent of their keymaps."
|
||||
(unless (equal cmd "merge-tree")
|
||||
(push "--ita-visible-in-index" args))
|
||||
(setq args (magit-diff--maybe-add-stat-arguments args))
|
||||
(when (magit--any (##string-prefix-p "--color-moved" %) args)
|
||||
(when (any (##string-prefix-p "--color-moved" %) args)
|
||||
(push "--color=always" args)
|
||||
(setq magit-git-global-arguments
|
||||
(append magit-diff--reset-non-color-moved
|
||||
@@ -2553,7 +2554,7 @@ keymap is the parent of their keymaps."
|
||||
"\\(-*\\)$")) ; del
|
||||
|
||||
(defun magit-diff-use-window-width-as-stat-width ()
|
||||
"Use the `window-width' as the value of `--stat-width'."
|
||||
"Use the `window-width' as the value of \"--stat-width\"."
|
||||
(and$ (get-buffer-window (current-buffer) 'visible)
|
||||
(list (format "--stat-width=%d" (window-width $)))))
|
||||
|
||||
@@ -2640,7 +2641,7 @@ keymap is the parent of their keymaps."
|
||||
(if (looking-at "^$") (forward-line) (insert "\n"))))))
|
||||
|
||||
(defun magit-diff-wash-diff (args)
|
||||
(when (magit--any (##string-prefix-p "--color-moved" %) args)
|
||||
(when (any (##string-prefix-p "--color-moved" %) args)
|
||||
(require 'ansi-color)
|
||||
(ansi-color-apply-on-region (point-min) (point-max)))
|
||||
(cond
|
||||
@@ -2756,8 +2757,10 @@ keymap is the parent of their keymaps."
|
||||
(setq orig (magit-decode-git-path orig)))
|
||||
(setq file (magit-decode-git-path file))
|
||||
(setq header (nreverse header))
|
||||
;; KLUDGE `git-log' ignores `--no-prefix' when `-L' is used.
|
||||
(when (and (derived-mode-p 'magit-log-mode)
|
||||
;; KLUDGE Before v2.54, "git log" ignored "--no-prefix"
|
||||
;; when "-L" is used.
|
||||
(when (and (magit-git-version< "2.54")
|
||||
(derived-mode-p 'magit-log-mode)
|
||||
(seq-some (##string-prefix-p "-L" %)
|
||||
magit-buffer-log-args))
|
||||
(when orig
|
||||
@@ -3022,7 +3025,7 @@ Staging and applying changes is documented in info node
|
||||
This function only inserts anything when `magit-show-commit' is
|
||||
called with a tag as argument, when that is called with a commit
|
||||
or a ref which is not a branch, then it inserts nothing."
|
||||
(when (magit-tag-p magit-buffer-revision)
|
||||
(when (magit-annotated-tag-p magit-buffer-revision)
|
||||
(magit-insert-section (taginfo)
|
||||
(let ((beg (point)))
|
||||
;; "git verify-tag -v" would output what we need, but the gpg
|
||||
@@ -3684,10 +3687,11 @@ actually a `diff' but a `diffstat' section."
|
||||
(magit--add-face-text-property
|
||||
bol (+ bol (if merging 2 1)) sign-face)))
|
||||
(forward-line)))
|
||||
(when (eq magit-diff-fontify-hunk 'all)
|
||||
(magit-diff--update-hunk-syntax section))
|
||||
(when (eq magit-diff-refine-hunk 'all)
|
||||
(magit-diff-update-hunk-refinement section))
|
||||
(unless (magit--meta-hunk-p section)
|
||||
(when (eq magit-diff-fontify-hunk 'all)
|
||||
(magit-diff--update-hunk-syntax section))
|
||||
(when (eq magit-diff-refine-hunk 'all)
|
||||
(magit-diff-update-hunk-refinement section)))
|
||||
(oset section painted (if highlight 'highlight 'plain)))
|
||||
|
||||
;;;; Whitespace
|
||||
@@ -3761,10 +3765,11 @@ actually a `diff' but a `diffstat' section."
|
||||
|
||||
;;;; Refinement
|
||||
|
||||
(cl-defmethod magit-section--refine ((section magit-hunk-section))
|
||||
(when (eq magit-diff-fontify-hunk t)
|
||||
(magit-diff--update-hunk-syntax section))
|
||||
(when (eq magit-diff-refine-hunk t)
|
||||
(cl-defmethod magit-section--refine ((section magit-hunk-section))
|
||||
(unless (magit--meta-hunk-p section)
|
||||
(when (eq magit-diff-fontify-hunk t)
|
||||
(magit-diff--update-hunk-syntax section))
|
||||
(when (eq magit-diff-refine-hunk t)
|
||||
(magit-diff-update-hunk-refinement section))))
|
||||
|
||||
(defun magit-diff-update-hunk-refinement (&optional section allow-remove)
|
||||
@@ -3821,7 +3826,8 @@ actually a `diff' but a `diffstat' section."
|
||||
(overlay-put o 'face face)))
|
||||
(forward-line 1))))))
|
||||
(named-let update ((section magit-root-section))
|
||||
(if (magit-section-match 'hunk section)
|
||||
(if (magit-section-match 'hunk section)
|
||||
(unless (magit--meta-hunk-p section)
|
||||
(magit-diff--update-hunk-syntax section))
|
||||
(dolist (child (oref section children))
|
||||
(update child))))))
|
||||
@@ -4016,11 +4022,15 @@ If `magit-diff-visit-previous-blob' is nil, then always return nil."
|
||||
(provide 'magit-diff)
|
||||
;; Local Variables:
|
||||
;; read-symbol-shorthands: (
|
||||
;; ("and$" . "cond-let--and$")
|
||||
;; ("and>" . "cond-let--and>")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("and$" . "cond-let--and$")
|
||||
;; ("thread$" . "cond-let--thread$")
|
||||
;; ("when$" . "cond-let--when$")
|
||||
;; ("and-let*" . "cond-let--and-let*")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("if-let*" . "cond-let--if-let*")
|
||||
;; ("if-let" . "cond-let--if-let")
|
||||
;; ("when-let*" . "cond-let--when-let*")
|
||||
;; ("when-let" . "cond-let--when-let")
|
||||
;; ("while-let*" . "cond-let--while-let*")
|
||||
;; ("while-let" . "cond-let--while-let")
|
||||
;; ("match-string" . "match-string")
|
||||
|
||||
Reference in New Issue
Block a user