-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use go#util#system(), go#util#shell_errors() instead of system(), v:shell_error #801
Conversation
let s:vim_shell_error = get(g:, 'gocomplete#shell_error_function', 'vimproc#get_last_status') | ||
else | ||
let s:vim_system = get(g:, 'gocomplete#system_function', 'system') | ||
let s:vim_shell_error = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storange indentation, will fix.
fu! s:system(str, ...) | ||
return call(s:vim_system, [a:str] + a:000) | ||
endf | ||
|
||
fu! s:gocodeShellescape(arg) | ||
if go#vimproc#has_vimproc() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be fixed as well, completion is broken with this.
Fixed. But I need to check more. |
Do you prefer |
|
||
function! go#util#system(str, ...) | ||
return call(s:vim_system, [a:str] + a:000) | ||
endfunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had time due my new son :) So I just had a new idea and curious about your thought. What if we add a function that returns both the output and shell error. A list that contains the following [out, shell_error]
? This way we could write code like this:
let [out, shell_error] = go#util#Run("command ...")
if shell_error != 0
return -1
endif
// continue with out
This would make it more safer to use and would emulate the way we use it in Go. Let me know what you think. We can do it in another PR btw :)
Checkout my other comment. For this question |
…hell_error NOTE: except bang command like "!go run"
Thanks @mattn 👍 |
errors from guru is ignored because when using vimproc. maybe having another issues with vimproc.