Skip to content

Commit

Permalink
feat: warn users of whitespace in module lists (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdbe authored Aug 5, 2024
1 parent 3c6f6f2 commit 362a306
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 10 additions & 0 deletions utils/module_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 362a306

Please sign in to comment.