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

Highlight lost when invoking zsh-history-substring-search #517

Closed GordianDziwis closed 1 year ago

GordianDziwis commented 1 year ago

I am trying to get: zdharma-continuum/fast-syntax-highlighting zsh-users/zsh-history-substring-search marlonrichert/zsh-autocomplete to work together. Highlighting gets removed when doing a substring search.

Environment

ubuntu linux-gnu /usr/bin/zsh zsh ubuntu/5.8.1-1
/home/beavis/.zshrc:161
f07efda (grafted, HEAD -> main, origin/main, origin/HEAD) Don't omit comments from displayed history lines
gnome-terminal

Steps to reproduce

  1. Replace .zshrc with:
    
    ZPLUGINDIR=$(mktemp -d)
    # get zsh_unplugged and store it with your other plugins
    if [[ ! -d $ZPLUGINDIR/zsh_unplugged ]]; then
    git clone --quiet https://github.com/mattmc3/zsh_unplugged $ZPLUGINDIR/zsh_unplugged
    fi
    source $ZPLUGINDIR/zsh_unplugged/zsh_unplugged.zsh
    plugins=(
    zdharma-continuum/fast-syntax-highlighting
    zsh-users/zsh-history-substring-search
    marlonrichert/zsh-autocomplete
    )
    plugin-load $plugins

bindkey '^k' history-substring-search-up bindkey '^j' history-substring-search-down


2.

```zsh
cd foo
cd ..
cd # press ^k and the highlight is lost.
GordianDziwis commented 1 year ago

Works perfectly now, thanks a lot.

kinland commented 1 year ago

There may have been a regression, but I'm not sure whether it's zsh-autocomplete or zsh-history-substring-search. I just filed an issue over there @ https://github.com/zsh-users/zsh-history-substring-search/issues/145

Basically, these combinations of plugins work:

But trying to use all 4 causes the zsh-history-substring-search highlight to disappear:- zsh-autocomplete + zsh-autosuggestions + zsh-syntax-highlighting + zsh-history-substring-search

Note that if I use zdharma-continuum/fast-syntax-highlighting instead of zsh-users/zsh-syntax-highlighting, then I can enable all 4 plugins with no issue.

marlonrichert commented 1 year ago

@dhorkin Can you check out the feature branch and see if it works correctly there?

kinland commented 1 year ago

@dhorkin Can you check out the feature branch and see if it works correctly there?

feature branch doesn't appear to make a difference

marlonrichert commented 1 year ago

@dyhork I'm curious: Why do you even use zsh-history-substring-search, when Autocomplete already has this feature?

kinland commented 1 year ago

@dyhork I'm curious: Why do you even use zsh-history-substring-search, when Autocomplete already has this feature?

The behavior is different, even if the end goals are similar. Depending on exactly what I'm trying to do, I will use one or the other

marlonrichert commented 1 year ago

How exactly does zsh-history-substring-search work differently? Wondering if I could let Autocomplete's history search cover the same use case.