Open bryanforbes opened 8 years ago
indeed - it behaves unexpectedly. will take a look
I've made a tiny fix for this and it work: 7cad1dc Can anyone check this?
This fix seems to work. I only tested my use-case, so I'm unsure if it possibly reverts the fix for #38. @gelguy, can you check this fix too?
The fix works to me also.
@tacahiroy fix seems to work great for me too :+1:
EDIT: Hmm, maybe not... Still don't have consistent behaviour when opening files. I expect it to open in my active split, but it doesn't do that consistently.
Sorry for the delay. The fix for #38 was just a type conversion check so it is quite unrelated to this issue.
The md =~ '[et]'
check is now missing so the setting g:ctrlp_switch_buffer
to anything with e
or t
might result in unexpected behaviour.
I'm rather rusty with the codebase right now but I'll see if I can find a solution.
This issue was introduced with #55. To reproduce the issue:
let g:ctrlp_switch_buffer='vt'
in~/.vimrc
:e ~/A.txt
:vsp ~/B.txt
(focus should be in the window for~/B.txt
):CtrlPBuffer
Enter
on the entry for~/A.txt
The focus will now move from the window for
B.txt
to the window forA.txt
. The expected behavior is that the buffer forA.txt
will display in the window whereB.txt
is displayed:According to the docs, leaving
E
ore
out of the string should prevent jumping to windows. From reading #38, it seems that the conditional needs further tweaking. When settingctrlp_switch_buffer
to a string withoutE
ore
but not0
(for instancevt
):!empty(s:jmptobuf)
is1
s:jmptobuf !~# '\v^0$'
is1
md =~ '[et]'
is1
This causes
jmpb
to be set which triggers the behavior of switching to an existing buffer at line 1048.