Skip to content

Commit

Permalink
Merge pull request #176 from b4b4r07/babarot/const
Browse files Browse the repository at this point in the history
Remove unneeded const variable
  • Loading branch information
b4b4r07 authored Mar 25, 2023
2 parents 6f5af00 + be2021b commit 2bde19d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
4 changes: 0 additions & 4 deletions conf.d/enhancd.fish
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function __enhancd_install --on-event enhancd_install
set -Ux ENHANCD_COMPLETION_KEYBIND "^I"

set -Ux _ENHANCD_VERSION "2.2.4"
set -Ux _ENHANCD_SUCCESS 0
set -Ux _ENHANCD_FAILURE 60

# Set the filters if empty
set -Ux ENHANCD_FILTER "fzy:fzf-tmux:fzf:peco:percol:gof:pick:icepick:sentaku:selecta"
Expand Down Expand Up @@ -62,8 +60,6 @@ function __enhancd_uninstall --on-event enhancd_uninstall
set --erase ENHANCD_COMPLETION_KEYBIND
set --erase ENHANCD_FILTER
set --erase _ENHANCD_VERSION
set --erase _ENHANCD_SUCCESS
set --erase _ENHANCD_FAILURE
end

# alias to enhancd
Expand Down
2 changes: 1 addition & 1 deletion functions/_enhancd_filter_interactive.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function _enhancd_filter_interactive

if test -z "$stdin"
echo "no entry" >&2
return $_ENHANCD_FAILURE
return 1
end

set -l filter (_enhancd_filepath_split_list "$ENHANCD_FILTER")
Expand Down
4 changes: 2 additions & 2 deletions functions/_enhancd_source_go_up.fish
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function _enhancd_source_go_up
if test "$status" = 1
if test -n $argv[1]
# Returns false if an argument is given
return $_ENHANCD_FAILURE
return 1
else
# Returns true when detecting to press Ctrl-C in selection
return $_ENHANCD_SUCCESS
return 0
end
end
end
2 changes: 0 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export ENHANCD_COMPLETION_KEYBIND="${ENHANCD_COMPLETION_KEYBIND:-^I}"
export ENHANCD_COMPLETION_BEHAVIOR="${ENHANCD_COMPLETION_BEHAVIOR:-default}"

export _ENHANCD_VERSION="2.2.4"
_ENHANCD_SUCCESS=0
_ENHANCD_FAILURE=60

if [[ -n $BASH_VERSION ]]; then
# BASH
Expand Down
4 changes: 2 additions & 2 deletions src/filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ __enhancd::filter::interactive()

if [[ -z ${stdin} ]]; then
echo "no entry" >&2
return $_ENHANCD_FAILURE
return 1
fi

local filter
Expand Down Expand Up @@ -101,7 +101,7 @@ __enhancd::filter::interactive()
if [[ -n ${stdin} ]]; then
echo "${stdin}"
else
return $_ENHANCD_FAILURE
return 1
fi
;;
*)
Expand Down
4 changes: 2 additions & 2 deletions src/sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ __enhancd::sources::go_up()
if [[ $? -eq 1 ]]; then
if [[ -n $1 ]]; then
# Returns false if an argument is given
return $_ENHANCD_FAILURE
return 1
else
# Returns true when detecting to press Ctrl-C in selection
return $_ENHANCD_SUCCESS
return 0
fi
fi
}
Expand Down

0 comments on commit 2bde19d

Please sign in to comment.