Created
February 5, 2017 12:09
-
-
Save hughshen/87fc3e218e04a45b1c6f19ae16e1ca94 to your computer and use it in GitHub Desktop.
Simple plugin for Sublime Text to display the opened files count in the status bar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class OpenedFilesCountPlugin(sublime_plugin.EventListener): | |
def __init__(self): | |
return | |
def on_activated(self, view): | |
self.update_status(view) | |
def on_new(self, view): | |
self.update_status(view) | |
def on_close(self, view): | |
self.update_status(view) | |
def update_status(self, view): | |
files_count = len(sublime.active_window().views()) | |
view.set_status('OpenedFilesCountPluginStatus', 'Editing %d file%s' % (files_count, ('s' if files_count > 1 else ''))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment