Skip to content

Commit

Permalink
refactor: @catppuccin_flavour -> @catppuccin_flavor (#277)
Browse files Browse the repository at this point in the history
Most catppuccin ports have adopted the spelling flavor.

`@catppuccin_flavour` is still available but no longer documented and
`@catppuccin_flavor` takes priority.
  • Loading branch information
vdbe committed Aug 14, 2024
1 parent 3ffbc37 commit 84a84bd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ set -g @plugin 'tmux-plugins/tpm'
3. (Optional) Set your preferred flavor, it defaults to `"mocha"`:

```bash
set -g @catppuccin_flavour 'mocha' # latte,frappe, macchiato or mocha
set -g @catppuccin_flavor 'mocha' # latte,frappe, macchiato or mocha
```

### Manual
Expand Down
13 changes: 11 additions & 2 deletions catppuccin.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main() {

# Batch options for loading the colorscheme and everyting before
add_tmux_batch_option "@catppuccin_custom_plugin_dir"
add_tmux_batch_option "@catppuccin_flavour"
add_tmux_batch_option "@catppuccin_flavor"

run_tmux_batch_commands

Expand All @@ -44,7 +44,16 @@ main() {
local color_interpolation=()
local color_values=()
local temp
theme="$(get_tmux_batch_option "@catppuccin_flavour" "mocha")"

theme="$(get_tmux_batch_option "@catppuccin_flavor" "")"

# NOTE: For backwards compatibility remove before 1.0.0 and set default for
# `@catppuccin_flavor` from `""` to `"mocha"`
if [ -z "$theme" ]; then
theme="$(get_tmux_option "@catppuccin_flavour" "mocha")"
tmux_echo "catppuccin warning: \\\"@catppuccin_flavour\\\" has been deprecated use \\\"@catppuccin_flavor\\\"" 103
fi

# NOTE: Pulling in the selected theme by the theme that's being set as local
# variables.
# https://github.com/dylanaraps/pure-sh-bible#parsing-a-keyval-file
Expand Down
4 changes: 2 additions & 2 deletions utils/module_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ load_modules() {

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\"" 100
tmux_echo "catppuccin warning: a module list has only white space, to remove all modules set it to \\\"null\\\"" 100
else
tmux_echo "catppuccin warning: a module list with value \"$modules_list\" has leading/trailing whitespace" 101
tmux_echo "catppuccin warning: a module list with value \\\"$modules_list\\\" has leading/trailing whitespace" 101
fi
continue
fi
Expand Down

0 comments on commit 84a84bd

Please sign in to comment.