neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
80.13k stars 5.51k forks source link

Implement a `TabMoved` autcommand event #23911

Open dasupradyumna opened 1 year ago

dasupradyumna commented 1 year ago

Problem

I like to configure my own tabline/statusline with tabnames and other information, and currently I have no way to detect when tabs are moved around. I have bound execution of the function updating my tabline/statusline components to all the available Tab* events; but TabMoved is missing. I am not using the GUI version or features other than my colors being 24-bit.

More discussion can be found in #6916.

This behavior can be reproduced with no plugins, no options and only a custom tabline/statusline function (which is the target of this problem).

Expected behavior

Except for builtin tabline, user-designed components cannot easily detect when tabs are reordered using :tabmove command. Currently, I'm using other events which occur more frequently so that the tabline/statusline component is updated often. This is a hack and clearly not the ideal approach.

yashlala commented 1 year ago

Done, see PR.

@dasupradyumna : does the API I've proposed work for you? Do you need additional information about the move via <amatch> or <afile>?

yashlala commented 1 month ago

Hi @dasupradyumna ; just wanted to bump on this issue again. I'd be happy to submit my PR for merging, but I want to make sure it addresses your needs first.

dasupradyumna commented 1 month ago

Sorry sorry. I'll check it out over the weekend.