yorickpeterse / nvim-window

Easily jump between NeoVim windows.
Mozilla Public License 2.0
97 stars 9 forks source link

feat: allow `pick()` to execute arbitary action #2

Closed willothy closed 1 year ago

willothy commented 1 year ago

If a function is passed to pick(), it is executed with the picked window as its only argument. Otherwise, pick() just sets the current window as normal.

yorickpeterse commented 1 year ago

@willothy What exactly is the reason for this change? The purpose of nvim-window is to simply switch the active window and nothing more. Your change suggests you want custom window switching logic, or not even switch windows at all and instead run arbitrary code. Unless there's a really good reason for this, this is not something that belongs in nvim-window.

willothy commented 1 year ago

That's fair! My main use case is to create a swap mapping that allows me to use the nice picker functionality of this plugin, but I totally understand if that's not something you want to merge :)

Could also be used for executing lsp actions, etc

yorickpeterse commented 1 year ago

@willothy That really sounds like something better implemented in a separate plugin, as nvim-window's focus is just swapping the active window :)

willothy commented 1 year ago

@willothy That really sounds like something better implemented in a separate plugin, as nvim-window's focus is just swapping the active window :)

Alright, for sure. Have a good one