mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-22 23:03:26 +03:00
Simplify removing unusable items
This commit is contained in:
parent
9e7f04d82e
commit
c5d7640415
@ -1,6 +1,4 @@
|
||||
function _tide_remove_unusable_items
|
||||
argparse f/fake -- $argv
|
||||
|
||||
# Remove tool-specific items for tools the machine doesn't have installed
|
||||
for item in chruby git nvm php rust virtual_env
|
||||
set -l cliName $item
|
||||
@ -12,13 +10,8 @@ function _tide_remove_unusable_items
|
||||
end
|
||||
|
||||
if not type -q $cliName
|
||||
if set -q _flag_fake
|
||||
_tide_find_and_remove $item fake_tide_left_prompt_items
|
||||
_tide_find_and_remove $item fake_tide_right_prompt_items
|
||||
else
|
||||
_tide_find_and_remove $item tide_left_prompt_items
|
||||
_tide_find_and_remove $item tide_right_prompt_items
|
||||
end
|
||||
_tide_find_and_remove $item tide_left_prompt_items
|
||||
_tide_find_and_remove $item tide_right_prompt_items
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -17,8 +17,6 @@ function finish
|
||||
end
|
||||
|
||||
function _tide_finish
|
||||
_tide_remove_unusable_items --fake
|
||||
|
||||
# Deal with prompt char/vi mode
|
||||
if contains prompt_char $fake_tide_left_prompt_items
|
||||
_tide_find_and_remove vi_mode fake_tide_right_prompt_items
|
||||
@ -36,4 +34,6 @@ function _tide_finish
|
||||
for fakeVar in (set --names | string match --regex "^fake_tide.*")
|
||||
set -U (string replace 'fake_' '' $fakeVar) $$fakeVar
|
||||
end
|
||||
|
||||
_tide_remove_unusable_items
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user