Commit 06aea3ad authored by Stephen M. Coakley's avatar Stephen M. Coakley

Do not touch the filesystem at all to switch theme

parent 8217eac3
...@@ -11,8 +11,6 @@ function omf.theme.set -a target_theme ...@@ -11,8 +11,6 @@ function omf.theme.set -a target_theme
set -l prompt_filename "fish_prompt.fish" set -l prompt_filename "fish_prompt.fish"
set -l user_functions_path (omf.xdg.config_home)/fish/functions set -l user_functions_path (omf.xdg.config_home)/fish/functions
mkdir -p "$user_functions_path"
if not omf.check.fish_prompt if not omf.check.fish_prompt
echo (omf::err)"Conflicting prompt setting."(omf::off) echo (omf::err)"Conflicting prompt setting."(omf::off)
echo "Run "(omf::em)"omf doctor"(omf::off)" and fix issues before continuing." echo "Run "(omf::em)"omf doctor"(omf::off)" and fix issues before continuing."
...@@ -26,12 +24,8 @@ function omf.theme.set -a target_theme ...@@ -26,12 +24,8 @@ function omf.theme.set -a target_theme
# Require new theme # Require new theme
require --theme $target_theme require --theme $target_theme
# Find target theme's fish_prompt and link to user function path # Make sure prompts are reloaded
for path in {$OMF_CONFIG,$OMF_PATH}/themes/$target_theme/$prompt_filename functions -e fish_prompt fish_right_prompt
if test -e $path
ln -sf $path $user_functions_path/$prompt_filename; and break
end
end
# If key bindings file found, reload fish key bindings # If key bindings file found, reload fish key bindings
test (count {$OMF_CONFIG,$OMF_PATH}/key_binding?.fish) -gt 0 test (count {$OMF_CONFIG,$OMF_PATH}/key_binding?.fish) -gt 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment