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: line.bufs().foreach() #157

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

feat: line.bufs().foreach() #157

wants to merge 12 commits into from

Conversation

capsey
Copy link
Contributor

@capsey capsey commented Sep 13, 2024

Add line.bufs().foreach() function for listing buffers. Works same way as line.tabs().foreach() and line.wins().foreach().

  1. Only shows listed buffers
  2. Makes buffer nodes clickable to switch current window to clicked buffer
  3. Adds buf.is_current(), buf.file_icon() and buf.name() analogously to TabbyWin

This is useful for people who cycle between buffers in a tab (like myself) using scope.nvim for tab-local buffers.

Relevant issues: #123, #86 (comment), #30

BREAKING CHANGE: Changes the API of tabby.module.filename and tabby.feature.buf_name to use bufid instead of winid

@nanozuki
Copy link
Owner

Welcome for feedback!

I want to ensure you want all buffers or "tab-local buffers". How to understand "tab-local buffers"? What is the different from windows.

@capsey
Copy link
Contributor Author

capsey commented Sep 14, 2024

Sorry for confusion, this feature itself just lists all buffers, the same way :ls does.

By "tab-local buffers" I just mean buffers that have been opened in current tab, even if not currently open in any window. This pull request doesn't implement them (it's out of scope of this plugin?), it was an example of an usecase together with other plugin - scope.nvim which does just that.

@nanozuki
Copy link
Owner

I read the "scope.nvim" and I got it. I want to accept this PR. Before that, I have there questions I want to discuss.

  1. How do you want to use buffers' list? There are many plugins for buffers, what is the advance in "tabby.nvim".
  2. Do you want to use buffers with 'scope.nvim'?
  3. I don't want to introduce breaking change for win.buf_name, can we duplicate this module and make a new one for buffers.buf.name?

How do you think?

@capsey
Copy link
Contributor Author

capsey commented Sep 19, 2024

  1. other tabline plugins i tried either don't offer much customization or have very limited features, i'm a big fan of the node structure of tabby
  2. me? yes
  3. okay, i'm gonna do that

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.

2 participants