Commit 0ac593a2 authored by Bruno's avatar Bruno

Merge pull request #150 from derekstavis/autoload-erase-no-copy

autoload: Use `set -e` to remove components from paths
parents 06b6b55a bf44c45c
......@@ -43,16 +43,10 @@ function autoload -d "Manipulate autoloading path components"
end
if set -q erase
not contains -- "$path" $$dest; and continue
# Make a copy of function path selected above
set -l function_path $$dest
set -l index (contains -i -- $path $function_path)
set -e function_path[$index]
# Set function path to modified copy
set $dest $function_path
set return_success
if set -l index (contains -i -- $path $$dest)
set -e {$dest}[$index]
set return_success
end
else
set return_success
contains -- "$path" $$dest; and continue
......
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