mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2025-03-26 03:31:32 +01:00
fix: use vbuff_from_view function.
This commit is contained in:
parent
dcb95a8cd8
commit
19bbc9c646
1 changed files with 6 additions and 2 deletions
8
main.py
8
main.py
|
@ -54,11 +54,15 @@ def kill_all():
|
|||
|
||||
session.stop()
|
||||
|
||||
def vbuff_form_view(view):
|
||||
def buffid_from_view(view):
|
||||
if not is_codemp_buffer(view):
|
||||
raise ValueError("The view is not a Codemp Buffer.")
|
||||
|
||||
buffid = str(view.settings().get(g.CODEMP_BUFFER_ID))
|
||||
return buffid
|
||||
|
||||
def vbuff_form_view(view):
|
||||
buffid = buffid_from_view(view)
|
||||
vbuff = buffers.lookupId(buffid)
|
||||
|
||||
return vbuff
|
||||
|
@ -178,7 +182,7 @@ class CodempClientViewEventListener(sublime_plugin.ViewEventListener):
|
|||
logger.debug("closing active view")
|
||||
safe_listener_detach(TEXT_LISTENER) # pyright: ignore
|
||||
try:
|
||||
bid = str(self.view.settings().get(g.CODEMP_BUFFER_ID))
|
||||
bid = buffid_from_view(self.view)
|
||||
vws = buffers.lookupParent(bid)
|
||||
some(self.view.window()).run_command(
|
||||
"codemp_leave_buffer",
|
||||
|
|
Loading…
Add table
Reference in a new issue