summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Core/_main_complete22
1 files changed, 9 insertions, 13 deletions
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index 169ca1f40..408a66ee3 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -93,19 +93,15 @@ fi
if [[ -z "$compstate[quote]" ]]; then
if [[ -o equals ]] && compset -P 1 '='; then
compstate[context]=equal
- elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then
- if [[ "$PREFIX" = '~['[^\]]# ]]; then
- # Inside ~[...] should be treated as a subscript.
- compset -p 2
- # To be consistent, we ignore all but the contents of the square
- # brackets.
- compset -S '\]*'
- compstate[context]=subscript
- [[ -n $_comps[-subscript-] ]] && $_comps[-subscript-] && return
- else
- compset -p 1
- compstate[context]=tilde
- fi
+ elif [[ "$PREFIX" = \~\[[^]]# ]]; then
+ # Inside ~[...] should be treated as a subscript.
+ compset -p 2
+ # To be consistent, we ignore all but the contents of the square brackets.
+ compset -S '\]*'
+ compstate[context]=subscript
+ elif [[ "$PREFIX" = \~[^/]# ]]; then
+ compset -p 1
+ compstate[context]=tilde
fi
fi