Skip to content
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

:tab drop does not fire BufEnter or TabEnter #1660

Closed
airblade opened this issue Apr 27, 2017 · 5 comments
Closed

:tab drop does not fire BufEnter or TabEnter #1660

airblade opened this issue Apr 27, 2017 · 5 comments

Comments

@airblade
Copy link

@airblade airblade commented Apr 27, 2017

Hello!

I would expect :tab drop file, where file is any file on the file system, to fire both TabEnter and BufEnter. However it doesn't:

$ vim -N -u NONE -c 'au BufEnter * echom "BufEnter"' -c 'au TabEnter * echom "TabEnter"'

[inside vim]
:tab drop file
:messages

In the messages I would expect to see (assuming file has 42 lines and 153 characters):

TabEnter
"file" 42L, 153C
BufEnter

I actually see:

"file" 42L, 153C

:tabedit file behaves as expected (as above), and :drop file behaves as expected (as above without the TabEnter).

I'm on Vim 8.0.525. I also found a report of what appears to be the same bug from 2011: BUG with autocmd BufEnter and 'tab drop'.

@brammool

This comment has been minimized.

Copy link
Member

@brammool brammool commented Apr 28, 2017

@airblade

This comment has been minimized.

Copy link
Author

@airblade airblade commented Apr 28, 2017

Thank you.

@LemonBoy

This comment has been minimized.

Copy link

@LemonBoy LemonBoy commented Apr 28, 2017

Looks like it is intentional [1] and dates back to vim 7.1 at least

[1] https://github.com/vim/vim/blob/master/src/buffer.c#L5010,L5012

@insidewhy

This comment has been minimized.

Copy link

@insidewhy insidewhy commented May 6, 2017

If it was intentional, is it a good idea? Without these events plugins can't know about files that are opened via :tab drop. For anyone who needs a :tab drop that produces these events I wrote a plugin.

@airblade

This comment has been minimized.

Copy link
Author

@airblade airblade commented Jan 14, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.