Reputation: 4761
There is sublime.View.set_status
method which adds message to status bar.
Is there a way to set position of that message? E.g. I'd like to have it on the right, before count of misspelled words, not on the left where Sublime adds it.
Upvotes: 1
Views: 281
Reputation: 22791
There is (after a fashion) a method of being able to specify where in the user addressable portion of the status bar the items you add will fall, but the key part there is user addressable
.
In particular, all items that can be added to the status bar by a plugin are always to the left of the standard status bar items such as Line 1, Column 1
and it's only in that left side area that it's possible to specify where the status item is added.
As such you can't place anything to the right of the standard position text or the spell checker's indication of how many words are misspelled.
Within the user addressable part, the status items that view.set_status()
adds to the status bar are ordered according to the key
value that you use when you set the key.
So for example view.set_status("AAAAA", "Something")
will appear on the left and view.set_status("ZZZZZ", "Otherthing")
will appear on the right.
This is only partial control since any plugin can add items to the status bar and it's impossible to know what other plugins might be adding items and what key
they will use.
I would presume that the ordering is done this way so that even though it's not possible to know with certainty exactly where the item is added, it's still done in a way that's repeatable so that for the user certain items are always in the same relative position while they're working.
This may be why the status bar items for core features such as the count of misspelled words are always placed in known positions.
Upvotes: 2