summaryrefslogtreecommitdiff
path: root/modes/magit/evil-collection-magit.el
diff options
context:
space:
mode:
authorAndrew Psaltis <apsaltis@vmware.com>2021-04-10 12:03:48 -0400
committerJames N <james@jojojames.com>2021-04-24 16:26:15 -0700
commit09b165d4c2ecac66224f674966c920c25d20f3f6 (patch)
tree1d41d8400f99a03d9466bc9288c910d614a8c2da /modes/magit/evil-collection-magit.el
parente32e871143a19ba9cbab73debe56d09969920887 (diff)
Magit: Properly format rebase instructions when commentChar is "%"
This change adjusts the formatting of the instructions in the `git-rebase` buffer to allow them to be properly formatted when git's `core.commentChar` is set to `%`. In particular, lines will look something like this: ``` %-8s p ``` The root cause seems to be the how the lines are constructed: comment characters are directly added to the format string. When it is `%`, `format` appears to proceed until it finds the next `%` character, (corresponding to the `%` in `%-8s`) above and prints it directly to the string rather than interpreting it something to format. This is fixed by constructing the format string with the comment character as an argument to `format` rather than being added directly to the format string. Fixes #468.
Diffstat (limited to 'modes/magit/evil-collection-magit.el')
-rw-r--r--modes/magit/evil-collection-magit.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/modes/magit/evil-collection-magit.el b/modes/magit/evil-collection-magit.el
index 896995b..663c268 100644
--- a/modes/magit/evil-collection-magit.el
+++ b/modes/magit/evil-collection-magit.el
@@ -508,7 +508,8 @@ denotes the original magit key for this command.")
(flush-lines (concat "^" (regexp-quote comment-start) ".+ = "))
(dolist (cmd evil-collection-magit-rebase-commands-w-descriptions)
(insert
- (format (concat comment-start " %-8s %s\n")
+ (format "%s %-8s %s\n"
+ comment-start
(if (and (car cmd)
(eq (nth 1 cmd)
(lookup-key aux-map (kbd (car cmd)))))