From b558c37b1f979a9d0c3a74ff9bbbff801241b761 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20M=C3=BCller?= <deso@posteo.net>
Date: Mon, 15 Jul 2024 20:17:32 -0700
Subject: [PATCH 1/3] Replace all percentage signs in template

The choose-buffer command, among others, accepts a template argument
containing a %% sequence that is replace with the chosen buffer.
However, only the first occurrence is actually replaced. This is brain
dead behavior. There is no apparent reason why not to replace all
occurrences. Adjust the code accordingly.
---
 cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd.c b/cmd.c
index 64fc0b..3e4e4f 100644
--- a/cmd.c
+++ b/cmd.c
@@ -876,7 +876,7 @@ cmd_template_replace(const char *template, const char *s, int idx)
 			} else {
 				if (*ptr != '%' || replaced)
 					break;
-				replaced = 1;
+				replaced = 0;
 				ptr++;
 				quote = SQ;
 				if (*ptr == '%') {
-- 
2.55.0

