Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default value for the time format should be empty #204

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

palkx
Copy link
Contributor

@palkx palkx commented Apr 22, 2023

Hello guys.

I've been using your theme for a while already and I've noticed that all time based options are not getting applied.
I've checked source code for the dracula.sh and I've noticed that option @dracula-time-format has a default value.

If we check time plugin source code we'll notice that if time_format isn't empty then it'll be used instead of the theme provided formats:

    elif [ $plugin = "time" ]; then
      IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white")
      if [ -n "$time_format" ]; then # Time format condition right here
        script=${time_format}
      else
        if $show_day_month && $show_military ; then # military time and dd/mm
          script="%a %d/%m %R ${timezone} "
        elif $show_military; then # only military time
          script="%a %m/%d %R ${timezone} "
        elif $show_day_month; then # only dd/mm
          script="%a %d/%m %I:%M %p ${timezone} "
        else
          script="%a %m/%d %I:%M %p ${timezone} "
        fi
      fi

The problem is even if I specify an empty value for the @dracula-time-format option - script will use a default value. This means that this theme will always use a custom time format specified, ignoring all other options.

Please see the following screenshots:

  1. What theme is showing by default right now:
    image
  2. What it should show by default:
    image

Thanks!

@ethancedwards8
Copy link
Member

Good catch. Thanks.

@ethancedwards8 ethancedwards8 merged commit 43fb1e5 into dracula:master Apr 23, 2023
1 check passed
@palkx palkx deleted the fix/time-format-is-not-applied branch April 24, 2023 13:14
@pataquets
Copy link
Contributor

I think this applies also to #200. Looks like default values should be used with care, I guess.
/cc @miknikif @ethancedwards8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants