22574: more history-beginning-search-menu fixes

This commit is contained in:
Peter Stephenson 2006-08-01 20:28:35 +00:00
parent ba22472b7f
commit 7d77bc95b2
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2006-08-01 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 22574: Functions/Zle/history-beginning-search-menu,
Doc/Zsh/params.yo: ~ also needs quoting and we have to do
it even if space isn't active.
2006-08-01 Peter Stephenson <pws@csr.com>
* 22573: Functions/Zle/history-beginning-search-menu,

View File

@ -221,7 +221,7 @@ the tt(EXTENDED_GLOB) option is set, the following is sufficient to
match an element of an array tt($array) containing exactly the value of
tt($key):
example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>]/\\$MATCH}
example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>~]/\\$MATCH}
print ${array[(R)$key2]})
)
item(tt(R))(

View File

@ -40,12 +40,12 @@ local -a display
local search=$LBUFFER
search=${search//(#m)[\][()\\*?#<>~]/\\$MATCH/}
if [[ $WIDGET = *-space* ]]; then
# We need to quote metacharacters in the search string
# since they are otherwise active in the reverse subscript.
# We need to avoid quoting other characters since they aren't
# and just stay quoted, rather annoyingly.
search=${search//(#m)[\][()\\*?#<>]/\\$MATCH/}
search=${search// /*}
fi
@ -112,7 +112,7 @@ fi
# go to the last one. This allows accept-line-and-down-history etc.
# to work.
local -a lines
local matchq=${matches[$chars]//(#m)[\][()\\*?#<>]/\\$MATCH}
local matchq=${matches[$chars]//(#m)[\][()\\*?#<>~]/\\$MATCH}
lines=(${(kon)history[(R)$matchq]})
HISTNO=$lines[-1]