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

feat(command): add BufferLineCloseOthers command #774

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

pirey
Copy link
Contributor

@pirey pirey commented Jun 17, 2023

This PR addresses the issue #317

In the issue, it was suggested to use :only, but :only will only close other windows, not buffers.

This new command can be used to close all buffers except the current one.

local index = M.get_current_element_index(state)
if not index then return end

for i, item in ipairs(vim.list_slice(state.components)) do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pirey why does this do a slice first? rather than just iterate the components?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, i was just trying things out.
i have updated it @akinsho

Copy link
Owner

@akinsho akinsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pirey the last thing this needs is to be added to the help documentation in bufferline.txt so other users know this exists

@pirey
Copy link
Contributor Author

pirey commented Jun 27, 2023

@akinsho
I have updated the doc file

Copy link
Owner

@akinsho akinsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now thanks 👍🏾

@akinsho akinsho merged commit 9d6ab3a into akinsho:main Jun 27, 2023
1 check passed
sstallion pushed a commit to sstallion/bufferline.nvim that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants