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

use <abuf> to identify buffer during events #40

Closed
wants to merge 1 commit into from

Conversation

deathlyfrantic
Copy link
Contributor

This should fix #39 - lclose can sometimes cause the tabline to
disappear even when there are multiple buffers remaining. Essentially
the problem is buftabline always assumes the buffer being deleted is the
current buffer, which is generally true, but not always true.

bufnr('%') gives us the number of the current buffer which is not
necessarily the buffer that is being added or deleted. expand('<abuf>')
gives us the number of buffer on which the event is operating, but as a
string - so we need to convert it to a number with str2nr. We can then
determine if the actual buffer being deleted is a user buffer or not.

I unintentionally committed some changes deleting some trailing
whitespace - let me know if you want me to revert those lines.

This should fix ap#39 - `lclose` can sometimes cause the tabline to
disappear even when there are multiple buffers remaining. Essentially
the problem is buftabline always assumes the buffer being deleted is the
current buffer, which is generally true, but not always true.

`bufnr('%')` gives us the number of the _current_ buffer which is not
necessarily the buffer that is being added or deleted. `expand(<abuf>)`
gives us the number of buffer on which the event is operating, but as a
string - so we need to convert it to a number with `str2nr`. We can then
determine if the actual buffer being deleted is a user buffer or not.
@ap
Copy link
Owner

ap commented Nov 17, 2017

Yeah I don’t want the debris in there and I want the commit message a little less verbose, plus the comment needs tweaking now. But it’s quicker if I just amend the commit myself. Coming up.

@ap
Copy link
Owner

ap commented Nov 17, 2017

Applied as e662ccd. Thank you for the patch. 😊

@ap ap closed this Nov 17, 2017
@ap ap added the bug label Nov 17, 2017
@ap ap added the resolved label Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabline sometimes disappears when closing location list
2 participants