nanozuki / tabby.nvim

A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
MIT License
588 stars 21 forks source link

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

Closed capsey closed 6 days ago

capsey commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago
  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
nanozuki commented 3 weeks ago

okay, i'm gonna do that

Do you have time recently? I like this PR, and I can continue to do it.

capsey commented 1 week ago

sorry for the late reply, yeah you can take over, i got a little busy