From 584bcbac7aca914e32cd67bf20ba0f3f38f44d17 Mon Sep 17 00:00:00 2001 From: Marlon Richert Date: Thu, 4 May 2023 15:40:55 +0300 Subject: [PATCH] Change how to check for history search completion Fixes #586. --- .../widget/.autocomplete.complete-word.completion-widget | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/widget/.autocomplete.complete-word.completion-widget b/functions/widget/.autocomplete.complete-word.completion-widget index 2cde3a0..7a14617 100644 --- a/functions/widget/.autocomplete.complete-word.completion-widget +++ b/functions/widget/.autocomplete.complete-word.completion-widget @@ -4,8 +4,8 @@ zmodload -F zsh/terminfo p:terminfo local +h curcontext=${curcontext:-${WIDGET}:::} local +h -a comppostfuncs=( .autocomplete.complete-word.post "$comppostfuncs[@]" ) -if [[ $_lastcomp[tags] == history-lines && -z $compstate[old_list] ]]; then - autocomplete:_main_complete:new - history-lines _autocomplete.history_lines +if [[ -z $compstate[old_list] && $curcontext == history-incremental-search* ]]; then + autocomplete:_main_complete:new - history-lines _autocomplete.history_lines elif [[ -z $compstate[old_list] ]] || [[ -v _autocomplete__partial_list && $WIDGETSTYLE == (|*-)(list|menu)(|-*) ]] || _autocomplete.should_insert_unambiguous; then