feat: Add sync command.

This commit is contained in:
cschen 2024-11-19 19:46:44 +01:00
parent a01fb8f291
commit b378173fb4
2 changed files with 11 additions and 0 deletions

View file

@ -116,4 +116,9 @@
// 'buffer_id': 'test'
}
},
{
"caption": "Codemp: Sync",
"command": "codemp_sync_buffer",
"args": {}
}
]

View file

@ -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()