File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ def prepare_payload(self):
40
40
path = current_file (self .nvim )
41
41
root_path = current_path (self .nvim )
42
42
rel_path = os .path .relpath (path , start = root_path ).split ('/' )
43
+ open_with = self .nvim .vars .get (
44
+ 'acid_open_alternate_file_with' ,
45
+ nvim .vars .get ('acid_open_new_file_with' , 'edit' )
46
+ )
43
47
44
48
if rel_path [0 ] in src :
45
49
log_debug ("Current file is a 'src', changing to 'test'" )
@@ -57,7 +61,7 @@ def prepare_payload(self):
57
61
)
58
62
59
63
if os .path .exists (alt_path ):
60
- self .nvim .command ('edit {}' .format (alt_path ))
64
+ self .nvim .command ('silent {} {} ' .format (open_with , alt_path ))
61
65
else :
62
66
ns = path_to_ns (alt_path , test | src )
63
67
self .nvim .command ('AcidNewFile {}' .format (ns ))
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ def prompt_default(nvim):
23
23
def prepare_payload (self , ns ):
24
24
fname = "{}.clj" .format (ns_to_path (ns ))
25
25
base = 'test' if ns .endswith ('-test' ) else 'src'
26
+ open_with = self .nvim .vars .get ('acid_open_new_file_with' , 'edit' )
26
27
path = os .path .join (current_path (self .nvim ), base , fname )
27
28
28
29
with open (path , 'w' ) as fpath :
29
30
fpath .write ('(ns {})' .format (ns ))
30
31
31
- self .nvim .command ('silent edit {}' .format (path ))
32
+ self .nvim .command ('silent {} {}' .format (open_with , path ))
32
33
33
34
# Does not interact with nrepl
34
35
return None
Original file line number Diff line number Diff line change @@ -126,8 +126,7 @@ def src_paths(nvim):
126
126
return {'src' , * nvim .vars .get ('acid_alt_paths' , [])}
127
127
128
128
def get_stop_paths (nvim ):
129
- return set () | test_paths (nvim ) | src_paths (nvim )
130
-
129
+ return {'test' , 'src' }
131
130
132
131
def find_file_in_path (nvim , msg ):
133
132
fname = msg ['file' ]
You can’t perform that action at this time.
0 commit comments