From 69dc7bea3c68f18a5a319ba2c73cef3130c2b55b Mon Sep 17 00:00:00 2001 From: Thomas Koutcher Date: Fri, 12 Nov 2021 20:02:53 +0100 Subject: [PATCH] Fix status line when toggling general options The regression was introduced by #944 in 80b40c20607d9d2b324c8a5a8c390d0c89de600b. Fixes #1163 --- src/prompt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/prompt.c b/src/prompt.c index bc037a953..253de6b4d 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -721,7 +721,9 @@ prompt_toggle_option(struct view *view, const char *argv[], const char *prefix, /* Define a partial version of success() to format the option name as a suffix to the view name, * thereby reducing the arguments needed by success() to only the option value and its format string. */ -#define Success(opt_fmt, opt_val) success(":set %s-view-%s = " opt_fmt, view->name, name, opt_val) +#define Success(opt_fmt, opt_val) *prefix \ + ? success(":set %s-view-%s = " opt_fmt, view->name, name, opt_val) \ + : success(":set %s = " opt_fmt, name, opt_val) char name[SIZEOF_STR];