feat: warn users of whitespace in module lists (#266)

This commit is contained in:
vdbe 2024-08-05 12:57:45 +00:00 committed by GitHub
parent 3c6f6f282b
commit 362a306db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -308,7 +308,7 @@ set -g @catppuccin_pane_background_color "#{thm_orange}"
#### Set the module list
```sh
set -g @catppuccin_status_modules_right "application session"
set -g @catppuccin_status_modules_left ""
set -g @catppuccin_status_modules_left "null"
```
Provide a list of modules and the order in which you want them to appear in the status.

View file

@ -32,6 +32,16 @@ load_modules() {
continue 2
fi
done
if [[ -z "${module_name/ }" ]]; then
if [[ -z "${modules_list/ }" ]]; then
tmux_echo "catppuccin warning: a module list has only white space, to remove all modules set it to \"null\""
else
tmux_echo "catppuccin warning: a module list with value \"$modules_list\" has leading/trailing whitespace"
fi
continue
fi
tmux_echo "catppuccin warning: module $module_name not found"