mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-03-15 17:16:20 +08:00
Handle scenarios where colors are not defined.
Fish should set default colors:
b32f770a69/share/functions/__fish_config_interactive.fish
But in case some users don't have these color variables set, use their
defaults values.
This commit is contained in:
parent
20ed43983b
commit
bfe77b6273
@ -16,10 +16,30 @@ set -g OMF_UNKNOWN_ERR 4
|
||||
|
||||
set -g OMF_VERSION "1.0.0"
|
||||
|
||||
function omf::em; set_color -o $fish_color_match; end
|
||||
function omf::dim; set_color -o $fish_color_autosuggestion; end
|
||||
function omf::err; set_color -o $fish_color_error; end
|
||||
function omf::off; set_color normal; end
|
||||
function omf::em
|
||||
if set -q fish_color_match
|
||||
set_color $fish_color_match
|
||||
else
|
||||
set_color cyan
|
||||
end
|
||||
end
|
||||
function omf::dim
|
||||
if set -q fish_color_autosuggestion
|
||||
set_color $fish_color_autosuggestion
|
||||
else
|
||||
set_color 555 yellow
|
||||
end
|
||||
end
|
||||
function omf::err
|
||||
if set -q fish_color_error
|
||||
set_color $fish_color_error
|
||||
else
|
||||
set_color red --bold
|
||||
end
|
||||
end
|
||||
function omf::off
|
||||
set_color normal
|
||||
end
|
||||
|
||||
function init -a path --on-event init_omf
|
||||
autoload $path/cli $path/util
|
||||
|
Loading…
x
Reference in New Issue
Block a user