mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2024-12-04 20:04:52 +01:00
feat: Add sync command.
This commit is contained in:
parent
a01fb8f291
commit
b378173fb4
2 changed files with 11 additions and 0 deletions
|
@ -116,4 +116,9 @@
|
||||||
// 'buffer_id': 'test'
|
// 'buffer_id': 'test'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"caption": "Codemp: Sync",
|
||||||
|
"command": "codemp_sync_buffer",
|
||||||
|
"args": {}
|
||||||
|
}
|
||||||
]
|
]
|
6
main.py
6
main.py
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue