Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: make history-complete-older do nothing on empty string



On Wed, 18 Apr 2018 14:20:42 +0200
Vincent Bernat <bernat@xxxxxxxx> wrote:
>    +_history:19> local opt expl max slice hmax=66742 beg=2
>     +_history:21> zstyle -t :completion:history-words:history::: remove-all-dups
>     +_history:22> opt=-
>     +_history:27> zstyle -t :completion:history-words:history::: sort
>     +_history:30> opt=-V
>     +_history:33> zstyle -s :completion:history-words:history::: range max
>     +_history:42> max=66742
>     +_history:43> slice=66742
>     +_history:46> PREFIX=''
>     +_history:47> IPREFIX=''
>     +_history:48> SUFFIX=''
>     +_history:49> ISUFFIX=''
>     +_history:54> local -a hslice
>     +_history:55> [[ 0 -eq 0 && beg -lt max ]]
>     +_history:56> [[ -n '' ]]
>     +_history:58> hslice=(

So when you interrupted it it was apparently reading in 66742 history
words; there's nothing further at the end of the file?  (We can tweak
complete_debug to add timing info if it's helpful, see below.)  Is the
behaviour acceptable if you use the style, for example:

zstyle ':completion:history-words:*' range 100

?

Here's a way of getting timing information in the debug by changing
_complete_debug (you'd probably have to copy it into your $fpath).

diff --git a/Completion/Base/Widget/_complete_debug b/Completion/Base/Widget/_complete_debug
index 85a0f37..1ff7630 100644
--- a/Completion/Base/Widget/_complete_debug
+++ b/Completion/Base/Widget/_complete_debug
@@ -15,7 +15,7 @@ integer debug_fd=-1
   fi
 
   local -a debug_indent; debug_indent=( '%'{3..20}'(e. .)' )
-  local PROMPT4 PS4="${(j::)debug_indent}+%N:%i> "
+  local PROMPT4 PS4="${(j::)debug_indent}+%D{%S.%.}:%N:%i> "
   setopt xtrace
   : $ZSH_NAME $ZSH_VERSION
   ${1:-_main_complete}


pws



Messages sorted by: Reverse Date, Date, Thread, Author