diff --git a/Codemp.sublime-commands b/Codemp.sublime-commands index d523fb2..c2c3e53 100644 --- a/Codemp.sublime-commands +++ b/Codemp.sublime-commands @@ -116,4 +116,9 @@ // 'buffer_id': 'test' } }, + { + "caption": "Codemp: Sync", + "command": "codemp_sync_buffer", + "args": {} + } ] \ No newline at end of file diff --git a/main.py b/main.py index d35d828..86ad0a9 100644 --- a/main.py +++ b/main.py @@ -100,6 +100,12 @@ class CodempReplaceTextCommand(sublime_plugin.TextCommand): self.view.replace(edit, region, content) +class CodempSyncBuffer(sublime_plugin.TextCommand): + def run(self, edit): + buff = buffers.lookupId(self.view.settings().get(g.CODEMP_BUFFER_ID)) + buff.sync(TEXT_LISTENER) + + class EventListener(sublime_plugin.EventListener): def is_enabled(self): return session.is_active()