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

Add support to create aliases for base24 themes #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshbode
Copy link
Contributor

No description provided.

@joshbode joshbode requested a review from a team as a code owner October 12, 2024 01:47
@joshbode joshbode requested review from belak and mattdavis90 and removed request for a team October 12, 2024 01:47
@joshbode joshbode force-pushed the joshbode/alias-24-themes branch from 1d22ec5 to cecb734 Compare October 13, 2024 12:04
@@ -110,10 +111,6 @@ set_theme()
done
unset hook
fi

unset theme_name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these variables are already local to the function

@@ -58,7 +58,8 @@ set_theme()
{
local theme_name="$1"
local force_load="$2"
local script_path="$BASE16_SHELL_PATH/scripts/base16-$theme_name.sh"
local n="${3-16}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the least disruptive option I could think of was to just add another argument. Alternatively the n could have been part of the theme name, but that would potentially break existing usage of set_theme since the theme name argument is stripped of the base{n}- prefix

theme_name=${script_name#"base${n}-"} # eg: solarized-light
function_name="base${n}_${theme_name}"

alias ${function_name}="set_theme ${theme_name} '' ${n}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the second argument is an empty string to not affect the force argument of set_theme

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

Successfully merging this pull request may close these issues.

1 participant