@@ -13,6 +13,7 @@ let s:utils.log = {}
1313
1414function ! OmniSharp#actions#test#Debug (nobuild, ... ) abort
1515 if ! s: utils .capabilities () | return | endif
16+ if ! s: utils .isrunning () | return | endif
1617 let s: nobuild = a: nobuild
1718 if ! OmniSharp#util#HasVimspector ()
1819 return s: utils .log .warn (' Vimspector required to debug tests' )
@@ -111,6 +112,7 @@ endfunction
111112
112113function ! OmniSharp#actions#test#Run (nobuild, ... ) abort
113114 if ! s: utils .capabilities () | return | endif
115+ if ! s: utils .isrunning () | return | endif
114116 let s: nobuild = a: nobuild
115117 let bufnr = a: 0 ? (type (a: 1 ) == type (' ' ) ? bufnr (a: 1 ) : a: 1 ) : bufnr (' %' )
116118 let RunTest = funcref (' s:run.single.test' , [a: 0 > 1 ? a: 2 : ' ' ])
@@ -186,6 +188,7 @@ endfunction
186188function ! OmniSharp#actions#test#RunInFile (nobuild, ... ) abort
187189 let s: nobuild = a: nobuild
188190 if ! s: utils .capabilities () | return | endif
191+ if ! s: utils .isrunning () | return | endif
189192 if a: 0 && type (a: 1 ) == type ([])
190193 let files = a: 1
191194 elseif a: 0 && type (a: 1 ) == type (' ' )
@@ -395,6 +398,10 @@ function! s:utils.capabilities() abort
395398 if g: OmniSharp_translate_cygwin_wsl
396399 return self .log .warn (' Tests do not work in WSL unfortunately' )
397400 endif
401+ return 1
402+ endfunction
403+
404+ function ! s: utils .isrunning () abort
398405 if s: run .running
399406 return self .log .warn (' A test is already running' )
400407 endif
0 commit comments