mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
To support older versions of zsh (< 5.0.8). We were missing the EXTENDED_GLOB option that allows use of `(#m)` flag.
This commit is contained in:
parent
a1babef972
commit
4ea825faf8
2 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,12 @@
|
||||||
# `HIST_EXPIRE_DUPS_FIRST`.
|
# `HIST_EXPIRE_DUPS_FIRST`.
|
||||||
|
|
||||||
_zsh_autosuggest_strategy_match_prev_cmd() {
|
_zsh_autosuggest_strategy_match_prev_cmd() {
|
||||||
|
# Reset options to defaults and enable LOCAL_OPTIONS
|
||||||
|
emulate -L zsh
|
||||||
|
|
||||||
|
# Enable globbing flags so that we can use (#m)
|
||||||
|
setopt EXTENDED_GLOB
|
||||||
|
|
||||||
# TODO: Use (b) flag when we can drop support for zsh older than v5.0.8
|
# TODO: Use (b) flag when we can drop support for zsh older than v5.0.8
|
||||||
local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
|
local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
|
||||||
|
|
||||||
|
|
|
@ -528,6 +528,12 @@ _zsh_autosuggest_strategy_default() {
|
||||||
# `HIST_EXPIRE_DUPS_FIRST`.
|
# `HIST_EXPIRE_DUPS_FIRST`.
|
||||||
|
|
||||||
_zsh_autosuggest_strategy_match_prev_cmd() {
|
_zsh_autosuggest_strategy_match_prev_cmd() {
|
||||||
|
# Reset options to defaults and enable LOCAL_OPTIONS
|
||||||
|
emulate -L zsh
|
||||||
|
|
||||||
|
# Enable globbing flags so that we can use (#m)
|
||||||
|
setopt EXTENDED_GLOB
|
||||||
|
|
||||||
# TODO: Use (b) flag when we can drop support for zsh older than v5.0.8
|
# TODO: Use (b) flag when we can drop support for zsh older than v5.0.8
|
||||||
local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
|
local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue