marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.22k stars 144 forks source link

_autocomplete.history_lines:19: invalid subscript when activating history right after a `clear` #257

Closed crazy-matt closed 3 years ago

crazy-matt commented 3 years ago
$ git -C ~zsh-autocomplete switch main  # Make sure you test with the `main` branch.
$ git -C ~zsh-autocomplete pull         # Update to the latest commit.
$ cd $(mktemp -d)                       # Create a temp dir and enter it.
$ unset _comp_dumpfile ZDOTDIR XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME
$ HOME=$PWD exec zsh -f       # Restart Zsh without config files in this dir.
% source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh
% clear
# press arrow up
_autocomplete.history_lines:19: invalid subscript

I want to highlight that I haven't run the entire procedure, my zsh-autocomplete points to the main branch. I run only from clear.

And I loaded these completion settings below in my env:

zstyle ':autocomplete:list-choices:*' max-lines 40%
zstyle ':autocomplete:*' list-lines 22
zstyle ':autocomplete:tab:*' fzf-completion yes
zstyle ':autocomplete:space:*' magic correct-word expand-history
zstyle ':autocomplete:*' groups always
zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:tab:*' insert-unambiguous yes
zstyle ':autocomplete:*' fuzzy-search on
zstyle ':autocomplete:*' key-binding on
zstyle ':autocomplete:*:no-matches-yet' message 'Type more...'
zstyle ':autocomplete:*:no-matches-at-all' message 'No match'

zstyle ':completion:*' ignore-parents pwd
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:descriptions' format $'\e[33;1m-- %d --\e[0m'
zstyle ':completion:*:messages' format $'\e[31;1m-- %d --\e[0m'
zstyle ':completion:*:warnings' format $'\e[31;1m-- No matches --\e[0m'
zstyle ':completion:*' list-dirs-first true

# Show hidden files
_comp_options+=(globdots)

zstyle ':completion:*:*:*:users' ignored-patterns \
        adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
        clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
        gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
        ldap lp mail mailman mailnull man messagebus  mldonkey mysql nagios \
        named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
        operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
        rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
        usbmux uucp vcsa wwwrun xfs '_*'
zstyle ':completion:*:functions' ignored-patterns '_*' '.*'
bindkey '^I' complete-word
marlonrichert commented 3 years ago

Sorry, but I cannot reproduce this with the steps you've given.