File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -644,7 +644,18 @@ def placeholder(self):
644644 return "host:port"
645645
646646 def initial_text (self ):
647- return conn .host + ":" + (str (conn .port ) if conn .port else "" )
647+ port = ''
648+ if conn .port :
649+ port = str (conn .port )
650+ window = sublime .active_window ()
651+ if window :
652+ for folder in window .folders ():
653+ if os .path .exists (folder + "/.nrepl-port" ):
654+ with open (folder + "/.nrepl-port" , "rt" ) as f :
655+ content = f .read (10 ).strip ()
656+ if re .fullmatch (r'[1-9][0-9]*' , content ):
657+ port = content
658+ return conn .host + ":" + port
648659
649660 def initial_selection (self ):
650661 return [(len (conn .host + ":" ), len (self .initial_text ()))]
Original file line number Diff line number Diff line change 66 subprocess .check_call (['clojure' ,
77 '-Sdeps' , '{:deps {nrepl/nrepl {:mvn/version "0.8.3"}}}' ,
88 '-M' , '-m' , 'nrepl.cmdline' ,
9- '--port' , '5555 '
9+ '--interactive '
1010 ])
You can’t perform that action at this time.
0 commit comments