mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2024-12-23 13:14:52 +01:00
fix: made the detaching of buffers on view close a sync function, to keep a reference to the window.
Former-commit-id: 69d58868687fb402232b97eb90de223161292ca3
This commit is contained in:
parent
5741a91ce2
commit
d96acdde48
1 changed files with 3 additions and 2 deletions
|
@ -384,10 +384,11 @@ class CodempClientViewEventListener(sublime_plugin.ViewEventListener):
|
|||
print("view {} deactivated".format(self.view.id()))
|
||||
safe_listener_detach(_txt_change_listener)
|
||||
|
||||
def on_close(self):
|
||||
def on_pre_close(self):
|
||||
global _client
|
||||
buffer = get_buffer_from_buffer_id(self.view.buffer_id())
|
||||
sublime_asyncio.dispatch(buffer.detach(_client))
|
||||
# have to run the detach logic in sync, to keep a valid reference to the view.
|
||||
sublime_asyncio.sync(buffer.detach(_client))
|
||||
|
||||
|
||||
class CodempClientTextChangeListener(sublime_plugin.TextChangeListener):
|
||||
|
|
Loading…
Reference in a new issue