diff --git a/autoload/go/cmd.vim b/autoload/go/cmd.vim index afe812fb21..7afbd808b1 100644 --- a/autoload/go/cmd.vim +++ b/autoload/go/cmd.vim @@ -9,7 +9,7 @@ function! go#cmd#autowrite() endfunction -" Build buils the source code without producting any output binary. We live in +" Build builds the source code without producting any output binary. We live in " an editor so the best is to build it to catch errors and fix them. By " default it tries to call simply 'go build', but it first tries to get all " dependent files for the current folder and passes it to go build. @@ -27,6 +27,7 @@ function! go#cmd#Build(bang, ...) " if we have nvim, call it asynchronously and return early ;) if has('nvim') + call go#util#EchoProgress("building dispatched ...") call go#jobcontrol#Spawn(a:bang, "build", args) return endif @@ -183,14 +184,19 @@ function! go#cmd#Test(bang, compile, ...) " expand all wildcards(i.e: '%' to the current file name) let goargs = map(copy(a:000), "expand(v:val)") - " escape all shell arguments before we pass it to test - call extend(args, go#util#Shelllist(goargs, 1)) + call extend(args, goargs, 1) else " only add this if no custom flags are passed let timeout = get(g:, 'go_test_timeout', '10s') call add(args, printf("-timeout=%s", timeout)) endif + if a:compile + echon "vim-go: " | echohl Identifier | echon "compiling tests ..." | echohl None + else + echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None + endif + if has('nvim') if get(g:, 'go_term_enabled', 0) call go#term#new(a:bang, ["go"] + args) @@ -200,12 +206,6 @@ function! go#cmd#Test(bang, compile, ...) return endif - if a:compile - echon "vim-go: " | echohl Identifier | echon "compiling tests ..." | echohl None - else - echon "vim-go: " | echohl Identifier | echon "testing ..." | echohl None - endif - call go#cmd#autowrite() redraw diff --git a/autoload/go/jobcontrol.vim b/autoload/go/jobcontrol.vim index 3dedd5c8f5..cfa668bf9e 100644 --- a/autoload/go/jobcontrol.vim +++ b/autoload/go/jobcontrol.vim @@ -100,10 +100,12 @@ function! s:on_exit(job_id, exit_status) call go#list#Window() let self.state = "SUCCESS" + call go#util#EchoSuccess("SUCCESS") return endif let self.state = "FAILED" + call go#util#EchoError("FAILED") let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' let dir = getcwd() diff --git a/autoload/go/term.vim b/autoload/go/term.vim index eaca0f5cb0..2b0d70999b 100644 --- a/autoload/go/term.vim +++ b/autoload/go/term.vim @@ -8,7 +8,7 @@ let s:jobs = {} " new creates a new terminal with the given command. Mode is set based on the " global variable g:go_term_mode, which is by default set to :vsplit function! go#term#new(bang, cmd) - call go#term#newmode(a:bang, a:cmd, g:go_term_mode) + return go#term#newmode(a:bang, a:cmd, g:go_term_mode) endfunction " new creates a new terminal with the given command and window mode. diff --git a/autoload/go/util.vim b/autoload/go/util.vim index 317910434f..3808044f11 100644 --- a/autoload/go/util.vim +++ b/autoload/go/util.vim @@ -64,7 +64,7 @@ function! go#util#Shelljoin(arglist, ...) endtry endfunction -" Shelljoin returns a shell-safe representation of the items in the given +" Shelllist returns a shell-safe representation of the items in the given " arglist. The {special} argument of shellescape() may optionally be passed. function! go#util#Shelllist(arglist, ...) try