marlonrichert / zsh-autocomplete

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

Since update history-beginning-search-backward not working #96

Closed artfulrobot closed 4 years ago

artfulrobot commented 4 years ago

Describe the bug

I just updated, (from c3359401f81bcfe26a9238a961391a05e3972e3b), and now my up-arrow behaviour is (a) different and (b) seems broken. My up-arrow key is bound to history-beginning-search-backward.

Before the update I could type ls hit ↑ and it would complete the line with the latest matching ls... from my history, repeated presses of ↑ went further throught the history lines starting with ls.

After the update two things happen

  1. I get a !351 which means nothing to me on the command line, and a huge one item per line list of history matches. (or it seems that using the dev branch I get the actual command (nicer) but still get the massive list.)

  2. If I select an entry with Enter I don't always get what I selected, as shown here where I select ls -la and get just ls:

autocomplete-issue

I would prefer not to get the menu as it scrolls everything else off screen and requires pressing Enter.

I suspect (2) is something to do with my other plugins, and I note your README says

Note for Oh My Zsh, Prezto and Zimfw users: zsh-autocomplete works best if you use it instead of your framework's supplied completion module.

Which suggests I need to disable something in omz to use this but I don't know what/how.

Desktop

marlonrichert commented 4 years ago

I'm working on a better version of the history menu. Once it's ready, I'll push it to master, but you can already try it out on the dev branch.

artfulrobot commented 4 years ago

My experience on the dev branch is that selection is still broken - hit up a few times, hit Enter on selected item and the completion goes away.

autocomplete-issue2

artfulrobot commented 4 years ago

The last working version for me is fd16c5ecf69

Actually it's 005da66 - it was commit c1f1560 that seemed to break things for me.

artfulrobot commented 4 years ago

@marlonrichert Hey these changes seem to have fixed things for me, thank you so much :+1:

artfulrobot commented 4 years ago

...Although I notice that zstyle ':autocomplete:tab:*' completion cycle seems broken now - should I open a separate issue for that?

e.g. I type lsTab and it inserts the first entry instead.

marlonrichert commented 4 years ago

It's because I'm working on #82. Read the Readme in the dev branch. The syntax has changed.

artfulrobot commented 4 years ago

Fab, thanks, (i hadn't thought to check the dev readme). I'm happy to close this.

marlonrichert commented 4 years ago

Fixed now on master.

cenk1cenk2 commented 4 years ago

First, I want to kindly thank you for your work on this amazing plugin.

I am not sure if to open up another issue or just write to this one but, the same problem is still a hit and miss for me in the current master branch.

It usually gets it in the second try. Sometimes it even doesn't. I can not seem to pinpoint what to do to make it consistently work, but mostly it seems it is kind of by luck.

The only configuration I have is:

zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:list-choices:*' max-lines 20%
zstyle ':autocomplete:tab:*' fzf yes

Tried different combinations, as well as the default one, none of them, unfortunately, seems to be working for me.

marlonrichert commented 4 years ago

@cenk1cenk2 Can you share your ~/.zshrc file? I would like to see what else you're using.

cenk1cenk2 commented 4 years ago

I use antigen to manage zsh installation via ansible with plugins:

          antigen_bundles:
            - name: git
            - name: command-not-found
            - name: history
            - name: fzf
            - name: docker
            - name: docker-compose
            - name: ssh-connect
              url: gko/ssh-connect
            - name: git-extra-commands
              url: unixorn/git-extra-commands
            - name: code-review-zsh
              url: xorkevin/code-review-zsh
            - name: cdbk
              url: MikeDacre/cdbk
            - name: cd-gitroot
              url: mollifier/cd-gitroot
            - name: zsh-autocomplete-full
              url: marlonrichert/zsh-autocomplete
            - name: zsh-syntax-highlighting
              url: zsh-users/zsh-syntax-highlighting
            - name: tmux-vim-integration.plugin.zsh
              url: jsahlen/tmux-vim-integration.plugin.zsh
            - name: yarn-autocompelete
              url: g-plane/zsh-yarn-autocompletions

Imported zsh files does not contain much, which can be summed as:

# keybinds
bindkey "\033[1~" beginning-of-line
bindkey "\033[4~" end-of-line
bindkey '^[OM' 'accept-line'

zstyle ':autocomplete:tab:*' widget-style menu-select
zstyle ':autocomplete:list-choices:*' max-lines 20%
zstyle ':autocomplete:tab:*' fzf yes

and some aliases and keybindings.

The hit and miss kind of behavior can be visualized here, similar to the original issue. If I move with tab or shift+tab it sometimes accepts it but the behavior is not consistent because sometimes it also works with arrow keys then enter. ezgif com-gif-maker (3)