forked from bollu/sublimeBookmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookmarkWatcher.py
23 lines (16 loc) · 938 Bytes
/
bookmarkWatcher.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sublime, sublime_plugin
class bookmarkWatcher(sublime_plugin.EventListener):
def on_activated_async(self, view):
sublime.active_window().run_command("sublime_bookmark", {"type": "mark_buffer" } )
sublime.active_window().run_command("sublime_bookmark", {"type": "move_bookmarks" } )
def on_modified_async(self, view):
sublime.active_window().run_command("sublime_bookmark", {"type": "move_bookmarks" } )
def on_deactivated_async(self, view):
sublime.active_window().run_command("sublime_bookmark", {"type": "mark_buffer" } )
sublime.active_window().run_command("sublime_bookmark", {"type": "move_bookmarks" } )
#must be no close, not on pre close. on pre-close,the view still exists
def on_close(self, view):
sublime.active_window().run_command("sublime_bookmark", {"type": "update_temporary" } )
def on_pre_save_async(self, view):
pass
#sublime.run_command("sublime_bookmark", {"type": "save_data" } )