-3

I installed a couple of plugins to add more features to sublime's status-bar, but it resulted in removing some basic features of it like getting number of matches of a specific word in Find. [check screenshot]
Plugin link: https://github.com/shagabutdinov/sublime-status-message
I tried removing all relevant plugins, no success.
So, how can I restore default settings of status bar, I tried writing a script to restore or shift the items in status bar with no fruitful result so far

enter image description here

  • I'm voting to reopen your question because sublime text is a source code editor, and questions about tools used primarily for programming are on topic here (the close banner says as much). But I removed EDIT2 from your question; you'll have to post it as an answer instead when your question is reopened. – Andras Deak -- Слава Україні Aug 12 '19 at 11:32
  • 1
    Your question has now been reopened. If you post your solution as an answer, you could self-answer and accept it (and you might get rep if other people find it useful as well). If you don't remember, or don't want to re-type it, you can recover it [from the revision history](https://stackoverflow.com/posts/57415550/revisions). – Zoe Aug 12 '19 at 11:46

2 Answers2

1

There isn't any mechanism by which a plugin can remove items from the status bar, they can only add extra items to it. Such added items appear to the left of the status bar items that Sublime generates on it's own such as the cursor position information or the find information that you're currently unable to see.

As such what you're actually experiencing is not that the default information has been removed but instead it's been pushed to the right of the status bar. If there is a lot of extra status information added or the window is narrow, that would have the effect of having those items appear to be gone because they're off the edge of the window.

Items added to the status bar remain for the current session until the plugin that added them removes them again. Most plugins that add items to the status bar likely don't track their own removal and remove any status items that they added.

To be fully rid of status items you don't want, after removing the offending plugin (to make sure it doesn't add them back) you need to either close and reopen all of the affected files (status bar items are specific to the tab they were added to) or quit and restart Sublime.

OdatNurd
  • 21,371
  • 3
  • 50
  • 68
  • Thanks for you suggestions, but if you check screenshot I added, you will find not much items added and there is quite empty space left for other items. After removing plugins, I did restart sublime but nothing happened. So my guess is this [plugin](https://github.com/shagabutdinov/sublime-status-message) did mess up the default items. I tried running a script to restore/shift existing items, but I only managed to add new items on the far left and only the cursor info are shifted. while previous items are still missing – Omar Elshal Aug 12 '19 at 08:03
  • The plugin was hiding default status-bar items, I just needed to unhide it. Check code snippet or plugin page in main post – Omar Elshal Aug 12 '19 at 10:18
  • That package exploits a bug in the API I mentioned above that makes items following the added item vanish. However the above still applies; as long as the package is installed it will keep doing that, but removing the package and restarting will revert the effect it has. – OdatNurd Aug 14 '19 at 21:38
0

I solved the issue, it's related to the plugin in question which does hide default items of sublime's status-bar, the items don't show up back even after removing the plugin. So, you have to use the plugin's API to restore status bar to default again.
The following script from their API can restore the default items back:

import sublime
import sublime_plugin
from StatusMessage import status_message

class RestoreDefaultStatus(sublime_plugin.TextCommand):
  def run(self, edit):
    status_message.hide_default_status = not status_message.hide_default_status
    status_message.refresh(self.view)