From 837d49959ec5d125604ef91c5d967caeb3ad7152 Mon Sep 17 00:00:00 2001 From: darcy Date: Fri, 26 Jan 2024 11:26:14 +1100 Subject: [PATCH] Fix user input after search Now when a user types `-` directly after searching, it is not treated as a commandline option by `zle` --- zsh-history-substring-search.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-history-substring-search.zsh b/zsh-history-substring-search.zsh index 471cc9a..ad3d61f 100644 --- a/zsh-history-substring-search.zsh +++ b/zsh-history-substring-search.zsh @@ -406,7 +406,7 @@ _history-substring-search-end() { # For debugging purposes: # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches} - # read -k -t 200 && zle -U $REPLY + # read -k -t 200 && zle -U -- $REPLY # # When this function returns, z-sy-h runs its line-pre-redraw hook. It has no @@ -421,7 +421,7 @@ _history-substring-search-end() { # before removing search highlight and exiting. This ensures no highlights # are left lingering after search is finished. # - read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U $REPLY + read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- $REPLY region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" ) fi