Commit a9177e5b authored by Kyle Meyer's avatar Kyle Meyer

magit-format-remote*tagOpt: account for remote's length

The "remote.<name>.tagOpts" variable is not aligned with the other
variables in the remote popup unless the remote is 6 characters (which
is unsurprisingly the length of "origin").  Beyond the cosmetic
alignment issue, calling magit-remote-popup when the current branch's
remote is over 7 characters triggers an error because
magit-popup-format-variable passes a negative length argument to
make-string.

Fix the above issues by calculating the WIDTH argument based on the
remote's length.
parent 4906d0ec
......@@ -293,9 +293,10 @@ Delete the symbolic-ref \"refs/remotes/<remote>/HEAD\"."
(magit-remote-config--format-variable "push"))
(defun magit-format-remote*tagOpt ()
(magit-popup-format-variable (format "remote.%s.tagOpts"
(magit-remote-config--remote))
'("--no-tags" "--tags") nil nil 22))
(let ((remote (magit-remote-config--remote)))
(magit-popup-format-variable (format "remote.%s.tagOpts" remote)
'("--no-tags" "--tags") nil nil
(+ (length remote) 16))))
(defun magit-remote-config--read-args (var prompt)
(let* ((remote (magit-remote-config--remote (format "Set `%s' of remote" var)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment