@@ -147,8 +147,8 @@ def set_status(self, phase, message, *args):
147147 cs_common .set_status (self .window , status_key , status )
148148
149149class AddressInputHandler (sublime_plugin .TextInputHandler ):
150- def __init__ (self , port_file = None , next_input = None ):
151- self .port_file = port_file
150+ def __init__ (self , port_files = [] , next_input = None ):
151+ self .port_files = port_files
152152 self .next = next_input
153153
154154 """
@@ -159,13 +159,14 @@ def placeholder(self):
159159
160160 def initial_text (self ):
161161 # .nrepl-port file present
162- if self .port_file and (window := sublime .active_window ()):
162+ if self .port_files and (window := sublime .active_window ()):
163163 for folder in window .folders ():
164- if os .path .exists (folder + "/" + self .port_file ):
165- with open (folder + "/" + self .port_file , "rt" ) as f :
166- content = f .read (10 ).strip ()
167- if re .fullmatch (r'[1-9][0-9]*' , content ):
168- return f'localhost:{ content } '
164+ for port_file in self .port_files :
165+ if os .path .exists (folder + "/" + port_file ):
166+ with open (folder + "/" + port_file , "rt" ) as f :
167+ content = f .read (10 ).strip ()
168+ if re .fullmatch (r'[1-9][0-9]*' , content ):
169+ return f'localhost:{ content } '
169170 state = cs_common .get_state ()
170171 return state .last_conn [1 ]['address' ] if state .last_conn else 'localhost:'
171172
0 commit comments