Zsh-autocomplete: When Oh My Zsh is sourced, insert-unambiguous does not work when fzf completion is also enabled

Created on 24 Oct 2020  路  4Comments  路  Source: marlonrichert/zsh-autocomplete

Environment

  • Zsh version: 5.8
  • zsh-autocomplete version: 4aa819f98e0577

Steps to reproduce

Please report if the bug occurs without config files:

$ cd $(mktemp -d)  # Create a temp dir and enter it.
$ ZDOTDIR=$PWD HOME=$PWD zsh -f  # Start a subshell in it without config files.
% touch prefix_{1..7}.txt  # Create seven files with identical prefixes to test partial completion
% source /Users/pawlu/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh  # Source the plugin.
% zstyle ':autocomplete:tab:*' insert-unambiguous yes
% zstyle ':autocomplete:tab:*' fzf yes
% [ -f /Users/pawlu/.fzf.zsh ] && source /Users/pawlu/.fzf.zsh  # Source fzf
% source /Users/pawlu/.oh-my-zsh/oh-my-zsh.sh  # Source Oh My Zsh
% cat pre<TAB>  # Try to invoke partial completion 
% cat prefix_1.txt  # Entirety of one file is completed

Does the bug occur without config files?

  • [x] Yes
  • [ ] No

Expected behavior

I expected the completion to insert the prefix, completing it to

% cat prefix_

Actual behavior

I entirety of the first file name was used in the completion, completing it to

% cat prefix_1.txt

Related to question on #82

Bug report

All 4 comments

Fixed, but please note that if you're going to source OMZ from the command line, it's still going to break. There's nothing I can do about that. But if you source everything in your ~/.zshrc file, then it should all be fine.

@marlonrichert I tried this again, but it still does not seem to work for me.

Using a .zshrc this time to avoid the issue you mentioned.

# My .zshrc
export ZSH=$HOME/.oh-my-zsh
plugins = (
    zsh-autocomplete
    zsh-autosuggestions
)
zstyle ':autocomplete:tab:*' insert-unambiguous yes
zstyle ':autocomplete:tab:*' fzf yes
source $ZSH/oh-my-zsh.sh
% cd $(mktemp -d)
% touch prefix_{1..3}.txt
% cat pre<TAB>
% cat prefix_1.txt

This time, it was actually a different problem than the last time, but it's fixed now, too.

@marlonrichert can confirm!

Thank you so much for both this project and the change!

Was this page helpful?
0 / 5 - 0 ratings