mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
feat(options): default statusline expression #33036
Problem: Default 'statusline' is implemented in C and not representable as a statusline expression. This makes it hard for user configs/plugins to extend it. Solution: - Change the default 'statusline' slightly to a statusline expression. - Remove the C implementation.
This commit is contained in:
@@ -1792,6 +1792,16 @@ static const char *did_set_statustabline_rulerformat(optset_T *args, bool rulerf
|
||||
}
|
||||
const char *errmsg = NULL;
|
||||
char *s = *varp;
|
||||
|
||||
// reset statusline to default when setting global option and empty string is being set
|
||||
if (args->os_idx == kOptStatusline
|
||||
&& ((args->os_flags & OPT_GLOBAL) || !(args->os_flags & OPT_LOCAL))
|
||||
&& s[0] == NUL) {
|
||||
xfree(*varp);
|
||||
*varp = xstrdup(get_option_default(args->os_idx, args->os_flags).data.string.data);
|
||||
s = *varp;
|
||||
}
|
||||
|
||||
if (rulerformat && *s == '%') {
|
||||
// set ru_wid if 'ruf' starts with "%99("
|
||||
if (*++s == '-') { // ignore a '-'
|
||||
|
Reference in New Issue
Block a user