-
Notifications
You must be signed in to change notification settings - Fork 29
/
bookmarkWatcher.py
31 lines (24 loc) · 1.24 KB
/
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
24
25
26
27
28
29
30
31
import sublime
import 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 on 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" } )