Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! Thanks for creating such a simple but yet useful plugin for tab management. I know that we may custom the plugin with our own functions, but I think having this custom labels feature may be useful in the core plugin.
Problem
There are times when I have layouts in tabs referring to some group of buffers, but I forgot the purpose of the group itself because the current file is not descriptive enough. For example, in a tab I have a layout with 3 handlers I'm modifying, but the filename is
index.py
, so when I see that in the tabs, it's hard to remember what this index was for.Solution
Having custom labels for specific tabs works, because you can set a name for each tab so instead of looking at the name
index.py
with the nice python icon, you will now seehandlers
with a 🌝 icon (We can change this, or add it to the setup config params as well).In the case that the custom tab has not been set (i.e. set to "default") the normal plugin behavior is expected, and no changes would be visible.
Caveats
We can catch the
TabCreate
andTabClose
events from nvim, and edit the labels table accordingly, but I have not found an easy way to detect whenever a user moves a tab position. This causes that when you move a tab, the custom label would be sticked to the last position. We can create another custom command such asLuatabLabelReset
to set the custom label todefault
again, and then the user would need to go to the next tab and set the custom label again withLuatabLabelRenam
.I'm happy to keep working on this if you think it's valuable, but first I would love to hear your thoughts about this. Thank you!