feat: Add sync command.

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

View file

@ -116,4 +116,9 @@
// 'buffer_id': 'test' // '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) 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): class EventListener(sublime_plugin.EventListener):
def is_enabled(self): def is_enabled(self):
return session.is_active() return session.is_active()