-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Redo #258, Revert #302 and Fix #235 #303
Conversation
merged https://github.com/ctrlpvim/ctrlp.vim/commits/master Thanks. |
Well, When the cursor on the NERTree and typeing CtrlP, new buffer is opended at NERDTree. Is this right? |
I think this fix is not perfect. |
I looked this. I guess we shouldn't revert #302. |
Like I said in the comment of the PR this is more of a hack that a perfect fix. So I didn't expect you to merge it right away.
No, this is indeed not right.
I don't really understand that patch as it doesn't seem to fix the problems I'm seeing. But I do agree this current fix is not complete and/or good enough. So we still need to work more on this issue to get to a proper fix 😞 Will invest some more time this evening... |
Okay, Sorry I didn't check before merging. Please don't mind. #302 is required fix even though this problems. So I'll merge this again. Let's think fix again. Thanks. |
Then, please explain how to reproduce your issue using NERDTree again. |
Check!
Yes, let me create a minimal In the mean time I suggest to revert commit 063b538 until we have a proper fix. |
Thanks! |
So this is a
Now with this
The file should now be opened wrongly in the See the animated gif below as an example: |
And some more additional info... After those 500ms waiting the
Which in turn causes this issue... |
Try this function! CtrlP_OpenAtCenter(...)
" find free window
for n in range(0, bufnr('$'))
if buflisted(n)
exe bufwinnr(n) . 'wincmd w'
break
endif
endfor
call call('ctrlp#acceptfile', a:000)
endfunction
let g:ctrlp_open_func = {
\ 'arg_type': 'dict',
\ 'files': 'CtrlP_OpenAtCenter',
\} |
If this works expected, I'll try to add new option to skip window to open new buffer. |
Added it to my test
And this indeed seems to work and seems to fix the problem! 🎉 Sorry for not understanding that comment before. But I guess we should build this in |
Yes, but maybe it will be new option. |
Hmm... Sorry but I continued with some additional testing of other cases, and there I still see the same issues. So let me cleanup some caches and run some proper tests to really make sure this indeed fixes the problem. Will get back to you shortly... |
Please explain how to reproduce. |
function! CtrlP_OpenAtCenter(...)
" find free window
for n in range(0, winnr('$'))
if buflisted(winbufnr(n))
exe n . 'wincmd w'
break
endif
endfor
call call('ctrlp#acceptfile', a:000)
endfunction
let g:ctrlp_open_func = {
\ 'arg_type': 'dict',
\ 'files': 'CtrlP_OpenAtCenter',
\} This seems better. |
No, this patch/fix doesn't work. To reproduce please do the following: Copy this into your
Then take the following steps:
If you look closely you'll notice that the second file will be opened in the left window instead of the active right window. It doesn't open in the |
The previous comment shows how to reproduce the first kind of issue (that the wrong window is selected). But now it even gets weirder when you just add this line to your
So to do another test, please copy this into your
Again follow the same steps:
But now, you'll see that it actually still selects the NERDTree window to open the second test file in. So clearly adding the custom function to the |
@mattn last night I thought about this problem some more, and I realised that I was wrong. I no longer think we should fix this problem in This problem is occurring not only when using So if we only fix it in |
The first two commits are to redo/undo earlier changes that were made related to this issue, that turn out to properly fix the problem.
The third commit is the hack/fix that fixes the problem. Yet I wonder if this is an acceptable fix, but if not hopefully it will help us get there.