mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-25 10:01:05 +01:00
parent
85ea943789
commit
b4b3a82ee3
3 changed files with 9 additions and 2 deletions
|
@ -17,5 +17,5 @@ _zsh_autosuggest_escape_command() {
|
||||||
setopt localoptions EXTENDED_GLOB
|
setopt localoptions EXTENDED_GLOB
|
||||||
|
|
||||||
# Escape special chars in the string (requires EXTENDED_GLOB)
|
# Escape special chars in the string (requires EXTENDED_GLOB)
|
||||||
echo -E "${1//(#m)[\\()\[\]|*?]/\\$MATCH}"
|
echo -E "${1//(#m)[\\()\[\]|*?~]/\\$MATCH}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,12 @@ assertTildeSuggestion() {
|
||||||
'cd ~/something'
|
'cd ~/something'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assertTildeSuggestionWithExtendedGlob() {
|
||||||
|
setopt local_options extended_glob
|
||||||
|
|
||||||
|
assertTildeSuggestion
|
||||||
|
}
|
||||||
|
|
||||||
assertParenthesesSuggestion() {
|
assertParenthesesSuggestion() {
|
||||||
set_history <<-'EOF'
|
set_history <<-'EOF'
|
||||||
echo "$(ls foo)"
|
echo "$(ls foo)"
|
||||||
|
@ -87,6 +93,7 @@ testSpecialCharsForAllStrategies() {
|
||||||
assertBackslashSuggestion
|
assertBackslashSuggestion
|
||||||
assertDoubleBackslashSuggestion
|
assertDoubleBackslashSuggestion
|
||||||
assertTildeSuggestion
|
assertTildeSuggestion
|
||||||
|
assertTildeSuggestionWithExtendedGlob
|
||||||
assertParenthesesSuggestion
|
assertParenthesesSuggestion
|
||||||
assertSquareBracketsSuggestion
|
assertSquareBracketsSuggestion
|
||||||
done
|
done
|
||||||
|
|
|
@ -360,7 +360,7 @@ _zsh_autosuggest_escape_command() {
|
||||||
setopt localoptions EXTENDED_GLOB
|
setopt localoptions EXTENDED_GLOB
|
||||||
|
|
||||||
# Escape special chars in the string (requires EXTENDED_GLOB)
|
# Escape special chars in the string (requires EXTENDED_GLOB)
|
||||||
echo -E "${1//(#m)[\\()\[\]|*?]/\\$MATCH}"
|
echo -E "${1//(#m)[\\()\[\]|*?~]/\\$MATCH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------#
|
#--------------------------------------------------------------------#
|
||||||
|
|
Loading…
Reference in a new issue