mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2025-03-26 03:31:32 +01:00
fix input handler so they can accept single elements
This commit is contained in:
parent
0931075d29
commit
34d8a7562c
2 changed files with 5 additions and 4 deletions
plugin
|
@ -1,12 +1,11 @@
|
|||
import sublime_plugin
|
||||
import logging
|
||||
|
||||
from typing import Tuple, Union, List
|
||||
|
||||
# Input handlers
|
||||
############################################################
|
||||
class SimpleTextInput(sublime_plugin.TextInputHandler):
|
||||
def __init__(self, args):
|
||||
if not isinstance(args, list):
|
||||
args = [args]
|
||||
self.input, *self.next_inputs = args
|
||||
self.argname, self.default = self.input
|
||||
|
||||
|
@ -29,6 +28,8 @@ class SimpleTextInput(sublime_plugin.TextInputHandler):
|
|||
|
||||
class SimpleListInput(sublime_plugin.ListInputHandler):
|
||||
def __init__(self, args):
|
||||
if not isinstance(args, list):
|
||||
args = [args]
|
||||
self.input, *self.next_inputs = args
|
||||
self.argname, self.list = self.input
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import logging
|
|||
from . import qp_globals as qpg
|
||||
|
||||
from ..core.workspace import workspaces
|
||||
from ..core.buffers import buffers
|
||||
# from ..core.buffers import buffers
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue