Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make completion widget show completion list, if it is not yet visible #340

Closed
rwmitchell opened this issue Sep 14, 2021 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@rwmitchell
Copy link

rwmitchell commented Sep 14, 2021

  • zsh-autocomplete version:
    118f8bb

  • Zsh version:

  • Framework:

  • Plugin manager:

  • Operating system:

Options as set:

zstyle ':autocomplete:*' fzf-completion yes
zstyle ':autocomplete:*' insert-unambiguous yes
zstyle ':autocomplete:*' min-delay 1.0
zstyle ':autocomplete:*' min-input 3
zstyle ':autocomplete:*' widget-style menu-select

fzf --version
0.27.2 (3f90fb4)

ls [TAB] still puts the first entry directly on the cmdline

image

ls z[TAB] has reverted back to the correct behavior of adding the unambiguous portion of the files that begin with z
but the menu of matches after that disappear after ~1-2 seconds, before I can get a screenshot of the correct behavior (which I don't consider clearing the menu the correct behavior)

The behavior I would like is for [TAB] to show the menu of options but put nothing on the cmdline as there are no beginning letters in common to all.

@rwmitchell rwmitchell added the bug Something isn't working label Sep 14, 2021
@marlonrichert marlonrichert added enhancement New feature or request and removed bug Something isn't working labels Sep 14, 2021
@marlonrichert
Copy link
Owner

The behavior I would like is for [TAB] to show the menu of options but put nothing on the cmdline as there are no beginning letters in common to all.

Sure, that seems like reasonable expectation. 👍

the menu of matches after that disappear after ~1-2 seconds, before I can get a screenshot of the correct behavior

I'm unable to reproduce that. Here's what I did:

% cd $( mktemp -d )
% >| .zshrc <<EOF
PS1="%# "
zstyle ':autocomplete:*' fzf-completion yes
zstyle ':autocomplete:*' insert-unambiguous yes
zstyle ':autocomplete:*' min-delay 1.0
zstyle ':autocomplete:*' min-input 3
zstyle ':autocomplete:*' widget-style menu-select
source /home/marlon/Git/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% HOME=$PWD ZDOTDIR=$PWD XDG_CACHE_HOME= XDG_CONFIG_HOME= XDG_DATA_HOME= zsh -d
% /home/linuxbrew/.linuxbrew/opt/fzf/install
% /home/linuxbrew/.linuxbrew/opt/fzf/install
Downloading bin/fzf ...
  - Already exists
  - Checking fzf executable ... 0.27.2
Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y

Generate /tmp/tmp.ExwxK3biIE/.fzf.bash ... OK
Generate /tmp/tmp.ExwxK3biIE/.fzf.zsh ... OK
Update fish_user_paths ... OK
Symlink /tmp/tmp.ExwxK3biIE/.config/fish/functions/fzf_key_bindings.fish ... OK

Do you want to update your shell configuration files? ([y]/n) y

Update /tmp/tmp.ExwxK3biIE/.bashrc:
  - [ -f ~/.fzf.bash ] && source ~/.fzf.bash
    - Already exists: line #1 

Update /tmp/tmp.ExwxK3biIE/.zshrc:
  - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    - Already exists: line #10 

Update /tmp/tmp.ExwxK3biIE/.config/fish/functions/fish_user_key_bindings.fish:
  - fzf_key_bindings
    - Already exists: line #2 

Finished. Restart your shell or reload config file.
   source ~/.bashrc  # bash
   source /tmp/tmp.ExwxK3biIE/.zshrc   # zsh
   fzf_key_bindings  # fish

Use uninstall script to remove fzf.

For more information, see: https://github.com/junegunn/fzf
% exec zsh -d
% mkdir -p Test etc hist powerline-shell powerline-shell zsh-auto zsh-completions zsh-functions
% ls z<TAB>
% ls zsh-
directory
zsh-auto/         zsh-completions/  zsh-functions/  
all matches
zsh-auto zsh-completions zsh-functions

After that, the completions stay on screen.

@marlonrichert marlonrichert self-assigned this Sep 14, 2021
@marlonrichert
Copy link
Owner

Alright, the new completion behavior has been implemented. 🙂 If you are able to reproduce the disappearing list with the template I provided above, then please open a new issue for that.

@marlonrichert marlonrichert changed the title insert-unambiguous does not work as expected Make completion widgets show completion list, if it is not yet visible Sep 22, 2021
@marlonrichert marlonrichert changed the title Make completion widgets show completion list, if it is not yet visible Make completion widget show completion list, if it is not yet visible Sep 22, 2021
@rwmitchell
Copy link
Author

I abandoned using it. It interrupted my workflow, doing things I didn't expect and not things I wanted. I'm sure it is just a conflict with configuration but I gave up trying to figure it out.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants