ctrlpvim / ctrlp.vim

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

loading empty buffer when reopening a file #25

Open mszoernyi opened 10 years ago

mszoernyi commented 10 years ago

I've a weird issue and I'm not sure how to debug this one or it might be a bug (I don't think so).

When I open a file with ctrlp and close this file (with hidden buffers set / set hidden) and try to open the same file again I get an empty buffer and the file name is the buffer id of the given file.

image

I've tried it without any other plugin enabled and a fresh vimrc as well. Same issue.

d11wtq commented 10 years ago

I'm unable to reproduce this. How are you closing the buffer? With :bd? And how are you re-opening the file?

mszoernyi commented 10 years ago

My workflow is basically:

  1. start vim
  2. ctrl+p, search for a random file (eg Gemfile)
  3. ctrl+p, search for another random file
  4. close one of the files with :q (eg Gemfile)
  5. ctrl+p search for the closed file (eg Gemfile)

The result is basically the screen I've postet. I could close the buffer with :bd but would like to have the buffer hidden instead of closed so I can reuse it without saving my changes for now.

It works while using :bd which might be a good solution (thanks for the hint) but in this case the buffer is closed and set hidden doesn't make any sense in my settings.

tacahiroy commented 10 years ago

hmm - Vim is closed at step 4, isn't it? Do I need to modify another random file at step 3?

mszoernyi commented 10 years ago

Thats why I opened two files to keep vim open (usually I have 4 open files for development)

For me ctrl-p opens a split if I open a second file for me and replaces this buffer from this point on. (Like DWM which is not installed). To be honest I'm not sure why this happens either especially it happens with a clean vim config (only ctrl-p installed) as well.

d11wtq commented 10 years ago

I have set hidden, but I always use :bd to close buffers. If I use :q, the entire Vim session is closed and Vim exits (unless I have split panes or tabs).

CtrlP shouldn't be opening a split unless you're using <c-o> or <c-v> to do that.

I just tried doing that (using <c-v>) and I still couldn't reproduce it. Can you post your ~/.vimrc? And what version of Vim?

wwalker commented 8 years ago

CtrlP will open in a split if your current buffer has unsaved changes.

However, even with that workflow, I can't reproduce @mszoernyi 's problem either.