ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.56k stars 259 forks source link

Ctrlp opens new file #105

Closed mhartington closed 9 years ago

mhartington commented 9 years ago

In neovim and vime, I'm getting this odd issue

If you try to open a file, it will cut the path name, so

"js/angular/controller/headerBarController.js" [New DIRECTORY]

becomes

"ular/controller/headerBarController.js" [New DIRECTORY]

Not sure if this is known. Here is the configuration for ctrlp in my .nvimrc

let g:ctrlp_user_command = 'ag %s -i --nogroup --hidden
    \ --ignore .git
    \ --ignore .svn
    \ --ignore .hg
    \ --ignore .DS_Store
    \ --ignore "**/*.pyc"
    \ --ignore lib
    \ -g ""'
  let g:ctrlp_regexp = 1
  let g:ctrlp_use_caching = 0
  let g:ctrlp_working_path_mode = 0
  let g:ctrlp_switch_buffer = 0
mattn commented 9 years ago

after getting fail, could you try to type :pwd?

nirum commented 9 years ago

I get the same error using Macvim. When I check the directory with pwd, it's the same directory as before.

mattn commented 9 years ago

hmm, I can't reproduce it.

mattn commented 9 years ago

if you use find instead of ag, you'll get same?

mhartington commented 9 years ago

after getting fail, could you try to type :pwd?

This does return the correct path.

if you use find instead of ag, you'll get same?

If I use the built in search from ctrl-p, it produces the same error.

mattn commented 9 years ago

If I use the built in search from ctrl-p, it produces the same error.

your vimrc seems having some settings that affect to ctrlp maybe. could you figure out which settings is wrong?

nirum commented 9 years ago

After stripping down my vimrc and trying things one at a time, I've localized the error to one plugin: the vim-devicons plugin. @mhartington do you also have this plugin enabled?

When I disable that plug-in, the bug goes away. Also, it looks like they recently added Ctrl-P support in this commit, which is maybe what is causing the bug.

nirum commented 9 years ago

Looks like the vim-devicons folks already know about the bug: https://github.com/ryanoasis/vim-devicons/issues/80

ryanoasis commented 9 years ago

Yep this is totally ryanoasis/vim-devicons#80 , there is a workaround as @nirum mentioned.

I have yet to replicate this personally but now multiple people have run into this so it should not be too hard to replicate, i'll need to redouble my efforts :blush:

Apologies :worried:

ryanoasis commented 9 years ago

@mhartington, @nirum this should be properly fixed now in https://github.com/ryanoasis/vim-devicons let me know if pulling latest v0.5.1 version resolves for you

@nirum thanks for the cross project reference

mhartington commented 9 years ago

Looks good to me. Thanks @ryanoasis

nirum commented 9 years ago

works for me too. thanks!