Skip to content

Commit

Permalink
Fix status line when toggling general options
Browse files Browse the repository at this point in the history
The regression was introduced by jonas#944 in 80b40c2.

Fixes jonas#1163
  • Loading branch information
koutcher committed Nov 13, 2021
1 parent 15aab28 commit bf2d97f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -856,7 +858,7 @@ prompt_toggle(struct view *view, const char *argv[], enum view_flag *flags)
struct sort_state *sort = &view->sort;

sort_view(view, sort_field);
return success("set %s = %s", option,
return success(":set %s = %s", option,
sort_field ? view_column_name(get_sort_field(view))
: sort->reverse ? "descending" : "ascending");
}
Expand Down

0 comments on commit bf2d97f

Please sign in to comment.