Revert "remove the timeout async call"

This reverts commit ed29c0c62a.
This commit is contained in:
cschen 2025-02-17 22:56:24 +01:00
parent 9766e26c5c
commit 6fe34f7bdb

View file

@ -101,17 +101,15 @@ class CodempLeaveBufferCommand(sublime_plugin.WindowCommand):
logging.error("The desired buffer is not managed by the workspace.") logging.error("The desired buffer is not managed by the workspace.")
return return
def _():
try: try:
buffers.remove(buffer_id) buffers.remove(buffer_id)
# del buff
# gc.collect()
finally: finally:
if not vws.handle.detach_buffer(buffer_id): if not vws.handle.detach_buffer(buffer_id):
logger.error(f"could not leave the buffer {buffer_id}.") logger.error(f"could not leave the buffer {buffer_id}.")
else: sublime.set_timeout_async(_)
logger.debug(f"successfully detached from {buffer_id}.")
# Create Buffer Comand # Leave Buffer Comand
class CodempCreateBufferCommand(sublime_plugin.WindowCommand): class CodempCreateBufferCommand(sublime_plugin.WindowCommand):
def is_enabled(self): def is_enabled(self):
return len(workspaces.lookup()) > 0 return len(workspaces.lookup()) > 0