Thanks for your reply
Could you give some more details how to do it?
I’m not Python developer but I assume that it should be fairly easy to add that kind of feature to ST2 and it’s very important to me, because I’m preparing SASS video course and it would be great if I could show everything on-the-fly in ST.
EDIT:
Success! You gave me a good hint and then I started to dig in Sublime Text API and “How to write a plugin” tutorials. I made two plugins and everything works as expected, but it’s some kind of a workaround. Anyway, thanks for help! Code that I wrote is below. Maybe someone will use it:
Plugin for reloading all opened files (all tabs)
[code]import sublime, sublime_plugin
class ReloadAllFilesCommand(sublime_plugin.WindowCommand):
def run(self):
# Run command after 1sec (i.e. wait for SASS to compile CSS)
sublime.set_timeout(self.focus_all_views, 1000);
def focus_all_views(self):
window = self.window
# Remember current view
current_view = window.active_view()
# Save group number
gr_number = window.num_groups()
# Loop through all groups
for i in range(0, gr_number):
# Focus group
window.focus_group(i)
# Save views in that group
views_in_i = window.views_in_group(i)
# Focus all views here
for inner_view in views_in_i:
window.focus_view(inner_view)
# Back to current view
window.focus_view(current_view)
[/code]
Plugin for saving file and reloading all opened files
[code]import sublime, sublime_plugin
class SaveAndReloadCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.run_command(“save”)
self.window.run_command(“reload_all_files”)[/code]
And finally, user key binding:
{ "keys": "ctrl+s"], "command": "save_and_reload" }
Maybe it’s not the best possible solution, but like I said - I’m not Python programmer and it’s my first ST2 plugin