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

[BUG] Git completion gets deleted #63

Closed
gbrlsnchs opened this issue Mar 19, 2020 · 2 comments
Closed

[BUG] Git completion gets deleted #63

gbrlsnchs opened this issue Mar 19, 2020 · 2 comments
Labels
bug

Comments

@gbrlsnchs
Copy link

@gbrlsnchs gbrlsnchs commented Mar 19, 2020

Describe the bug
When I type the first path segment of a directory as an argument for a Git command, the path gets deleted from prompt.

To Reproduce
Steps to reproduce the behavior:

  1. Create a testing directory
  2. cd into that directory and initialize a Git repo with git init
  3. mkdir foo
  4. touch foo/bar
  5. Type git add foo
  6. Press Tab
  7. See error: foo gets deleted and the cursor goes back one step

This always happens when you type the exact name of the directory. If you type only part of it, you get the right completion. If you put the final slash after foo, it also works as expected.

Expected behavior
It should complete with a slash in order to allow subsequent completions.

Screenshots
I made an asciicast of the problem:
asciicast

Environment (please complete the following information):

  • OS: Void Linux
  • zsh version: zsh 5.8 (x86_64-unknown-linux-gnu)
  • fzf-tab version: f0627fe

zshrc

prompt_cmd() {
  eval "$PROMPT_COMMAND"
}

precmd_functions=(prompt_cmd)

source /usr/share/google-cloud-sdk/completion.zsh.inc
source $XDG_DATA_HOME/antigen/antigen.zsh

antigen use oh-my-zsh
antigen bundle git
antigen bundle vi-mode
antigen bundle command-not-found
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle Aloxaf/fzf-tab
antigen theme lambda
antigen apply

source /usr/share/doc/fzf/completion.zsh
source /usr/share/doc/fzf/key-bindings.zsh

_gen_fzf_default_opts() {
    local gruvbox_bg0='#282828'
    local gruvbox_bg1='#3c3836'
    local gruvbox_bg3='#665c54'
    local gruvbox_red='#cc241d'
    local gruvbox_green='#98971a'
    local gruvbox_yellow='#d79921'
    local gruvbox_blue='#458588'
    local gruvbox_purple='#b16286'
    local gruvbox_aqua='#689d6a'
    local gruvbox_gray='#a89984'
    local gruvbox_gray_alt='#928374'
    local gruvbox_red_alt='#fb4934'
    local gruvbox_green_alt='#b8bb26'
    local gruvbox_yellow_alt='#fabd2f'
    local gruvbox_blue_alt='#83a598'
    local gruvbox_purple_alt='#d3869b'
    local gruvbox_aqua_alt='#8ec07c'
    local gruvbox_orange='#d65d0e'
    local gruvbox_fg1='#ebdbb2'
    local gruvbox_fg4='#a89984'

    export FZF_DEFAULT_OPTS="
      --color=bg+:$gruvbox_bg1,bg:$gruvbox_bg0,spinner:$gruvbox_yellow,hl:$gruvbox_yellow
      --color=fg:$gruvbox_fg1,header:$gruvbox_bg3,info:$gruvbox_blue,pointer:$gruvbox_blue
      --color=marker:$gruvbox_orange,fg+:$gruvbox_fg1,prompt:$gruvbox_fg4,hl+:$gruvbox_yellow
    "

    export FZF_DEFAULT_COMMAND="rg --files --hidden --follow --glob '!.git'"
}

_gen_fzf_default_opts
@gbrlsnchs gbrlsnchs added the bug label Mar 19, 2020
Aloxaf added a commit that referenced this issue Mar 20, 2020
see #63
`git init; mkdir -p foo/bar; git add foo\t` will add an empty match
with `/` as hidden prefix to just add a slash.
@Aloxaf

This comment has been minimized.

Copy link
Owner

@Aloxaf Aloxaf commented Mar 20, 2020

Thanks for your report!
Fixed. Please update fzf-tab and try again.

@gbrlsnchs

This comment has been minimized.

Copy link
Author

@gbrlsnchs gbrlsnchs commented Mar 20, 2020

That was fast, thank you very much, it's working now! ❤️

@gbrlsnchs gbrlsnchs closed this Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.