{"action":"created","issue":{"url":"https://api.github.com/repos/junegunn/fzf/issues/288","labels_url":"https://api.github.com/repos/junegunn/fzf/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/junegunn/fzf/issues/288/comments","events_url":"https://api.github.com/repos/junegunn/fzf/issues/288/events","html_url":"https://github.com/junegunn/fzf/issues/288","id":94807116,"number":288,"title":"Sourcing .fzf.bash changes tabbing behavior","user":{"login":"tonglil","id":3250776,"avatar_url":"https://avatars.githubusercontent.com/u/3250776?v=3","gravatar_id":"","url":"https://api.github.com/users/tonglil","html_url":"https://github.com/tonglil","followers_url":"https://api.github.com/users/tonglil/followers","following_url":"https://api.github.com/users/tonglil/following{/other_user}","gists_url":"https://api.github.com/users/tonglil/gists{/gist_id}","starred_url":"https://api.github.com/users/tonglil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonglil/subscriptions","organizations_url":"https://api.github.com/users/tonglil/orgs","repos_url":"https://api.github.com/users/tonglil/repos","events_url":"https://api.github.com/users/tonglil/events{/privacy}","received_events_url":"https://api.github.com/users/tonglil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-13T20:44:15Z","updated_at":"2015-07-25T04:37:41Z","closed_at":null,"body":"## Issue\r\n\r\nIn the command line, when I source the completion, it will make tabbing produce a space character.\r\n\r\nIf I type:\r\n```\r\ngit add[tab]\r\n```\r\n\r\nI will get\r\n```\r\ngit add [2 space characters here]\r\n```\r\n\r\nIf there is a directory called \"folder\" and I type:\r\n```\r\ngit add fol[tab]\r\n```\r\n\r\nI will get\r\n```\r\ngit add folder/[space character here]\r\n```\r\n\r\nAnd cannot continue to tab for files in that folder because there is now a space separator there.\r\n\r\n## Info\r\n\r\n- fzf is installed via brew, installed HEAD today.\r\n- OS X 10.10.4\r\n- `git version 2.3.2 (Apple Git-55)` or `git version 2.4.5`\r\n\r\nThese are the other completes I am currently sourcing:\r\n```sh\r\n    # Bash Brew Completion\r\n    if [ -f $(brew --prefix)/etc/bash_completion ]; then\r\n      souce $(brew --prefix)/etc/bash_completion\r\n    fi\r\n\r\n    # Git Tab Complete\r\n    source /usr/local/git/contrib/completion/git-completion.bash\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/junegunn/fzf/issues/comments/124796421","html_url":"https://github.com/junegunn/fzf/issues/288#issuecomment-124796421","issue_url":"https://api.github.com/repos/junegunn/fzf/issues/288","id":124796421,"user":{"login":"junegunn","id":700826,"avatar_url":"https://avatars.githubusercontent.com/u/700826?v=3","gravatar_id":"","url":"https://api.github.com/users/junegunn","html_url":"https://github.com/junegunn","followers_url":"https://api.github.com/users/junegunn/followers","following_url":"https://api.github.com/users/junegunn/following{/other_user}","gists_url":"https://api.github.com/users/junegunn/gists{/gist_id}","starred_url":"https://api.github.com/users/junegunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junegunn/subscriptions","organizations_url":"https://api.github.com/users/junegunn/orgs","repos_url":"https://api.github.com/users/junegunn/repos","events_url":"https://api.github.com/users/junegunn/events{/privacy}","received_events_url":"https://api.github.com/users/junegunn/received_events","type":"User","site_admin":false},"created_at":"2015-07-25T04:37:41Z","updated_at":"2015-07-25T04:37:41Z","body":"The fuzzy completion from fzf falls back to the original completion function that was defined on the command when the trigger sequence is not found. This works fine for most cases:\r\n\r\n```sh\r\n> complete | grep vim\r\ncomplete -F _filedir_xspec rvim\r\ncomplete -F _filedir_xspec gvim\r\ncomplete -F _filedir_xspec vim\r\ncomplete -F _filedir_xspec rgvim\r\n> source ~/.fzf.bash\r\n> complete | grep vim\r\ncomplete -o bashdefault -o default -F _fzf_file_completion mvim\r\ncomplete -F _filedir_xspec rvim\r\ncomplete -o bashdefault -o default -F _fzf_file_completion gvim\r\ncomplete -o bashdefault -o default -F _fzf_file_completion vim\r\ncomplete -F _filedir_xspec rgvim\r\n> echo $_fzf_orig_completion_vim\r\n_filedir_xspec\r\n```\r\n\r\nHowever, this ticks doesn't work for git completion as they are defined with `-o nospace` option:\r\n\r\n```sh\r\n> complete | grep git\r\ncomplete -o bashdefault -o default -o nospace -F __git_wrap__git_main git\r\ncomplete -o bashdefault -o default -o nospace -F __git_wrap__gitk_main gitk\r\n```\r\n\r\nIt might be possible, though it feels like a very over-engineered solution, that we remember all the previous options and dynamically restore the options using `compopt` when fzf has to fall back to the original. However, it looks like `compopt` is not available on OS X."}}