0

Removal of status message only after selection or focus changed

Oktay Acikalin 14 jaar geleden bijgewerkt 14 jaar geleden 4
I have a bunch of plugins which throw out status messages after a certain action. E.g. on_activated shows the current filename including path and syntax in the status bar. The problem is that it goes away far to quickly. I think, it would be better, if one could define a message to be sticky. With sticky I mean that only a change of the selection (e.g. cursor moved) or focus or a new message etc. let's the message vanish.
E.g.
sublime.status_message('Hello World', sticky=True)
What if you used view.set_status, and then in your on_selection_modified and view.on_deactivated callbacks you called view.erase_status?
This could create conflicts (multiple plugins throwing out messages) and one would have to track status_ids. The messages would have to be joined somehow not to hide some information and the status bar will get filled up soon. I don't think we need this complexity :).
Do you have a lot of different status IDs?
I do agree that the status message could be more persistent, but I don't think you should need to pass a flag—It'd be nice if all status messages lasted until you did something or for a minimum amount of time, whichever is longer.
I fear those IDs might pile up with time and more plugins on the roll. Currently I don't want to fiddle with them.
I would be perfectly fine if they would stay sticky until one does something. The optional flag was just an idea for backward compatibility and not messing with the current implementation.
I could also live with a mix of both like you said, as long as I can set it to something like 30 seconds or more :).
But I could also think of situations, where you would only want it to show for some seconds and not any longer. Perhaps it would be better to let the user define the timeout and the developer if it should be sticky?