Merge pull request #383 from underwoo/case-sensitive
lib/shopt: Allow CASE_SENSITIVE and HYPHEN_INSENSITIVE to work as documented
This commit is contained in:
commit
ec7efa5628
15
lib/shopt.sh
15
lib/shopt.sh
@ -43,10 +43,19 @@ if [[ ${OMB_CASE_SENSITIVE:-${CASE_SENSITIVE:-}} == true ]]; then
|
|||||||
else
|
else
|
||||||
# By default, case sensitivity is disabled.
|
# By default, case sensitivity is disabled.
|
||||||
bind "set completion-ignore-case on"
|
bind "set completion-ignore-case on"
|
||||||
fi
|
|
||||||
|
|
||||||
# Treat hyphens and underscores as equivalent
|
# Treat hyphens and underscores as equivalent
|
||||||
bind "set completion-map-case on"
|
# CASE_SENSITIVE must be off
|
||||||
|
if [[ ! ${OMB_HYPHEN_SENSITIVE-} && ${HYPHEN_INSENSITIVE} ]]; then
|
||||||
|
case $HYPHEN_INSENSITIVE in
|
||||||
|
(true) OMB_HYPHEN_SENSITIVE=true ;;
|
||||||
|
(false) OMB_HYPHEN_SENSITIVE=false ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if [[ ${OMB_HYPHEN_SENSITIVE-} == false ]]; then
|
||||||
|
bind "set completion-map-case on"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Display matches for ambiguous patterns at first tab press
|
# Display matches for ambiguous patterns at first tab press
|
||||||
bind "set show-all-if-ambiguous on"
|
bind "set show-all-if-ambiguous on"
|
||||||
|
@ -16,7 +16,7 @@ OSH_THEME="font"
|
|||||||
|
|
||||||
# Uncomment the following line to use hyphen-insensitive completion. Case
|
# Uncomment the following line to use hyphen-insensitive completion. Case
|
||||||
# sensitive completion must be off. _ and - will be interchangeable.
|
# sensitive completion must be off. _ and - will be interchangeable.
|
||||||
# HYPHEN_INSENSITIVE="true"
|
# OMB_HYPHEN_SENSITIVE="false"
|
||||||
|
|
||||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||||
# DISABLE_AUTO_UPDATE="true"
|
# DISABLE_AUTO_UPDATE="true"
|
||||||
|
Loading…
Reference in New Issue
Block a user