fix create buffer input handlers

This commit is contained in:
cschen 2025-02-17 22:36:31 +01:00
parent feed0fa9c9
commit c97a276d71

View file

@ -117,13 +117,14 @@ class CodempCreateBufferCommand(sublime_plugin.WindowCommand):
return "Create Buffer: " return "Create Buffer: "
def input(self, args): def input(self, args):
if "workspace_id" not in args: missingargs = [arg for arg in ["workspace_id", "buffer_id"] if arg not in args]
wslist = session.client.active_workspaces() for arg in missingargs:
return SimpleListInput( if arg == "workspace_id":
("workspace_id", wslist), return SimpleListInput([
) ("workspace_id", session.client.active_workspaces()),
("buffer_id", "new buffer name")
if "buffer_id" not in args: ])
if arg == "buffer_id":
return SimpleTextInput( return SimpleTextInput(
("buffer_id", "new buffer name"), ("buffer_id", "new buffer name"),
) )