-
-
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
Path issues on :GoDef in Windows #1082
Comments
Maybe you want to see #1013 |
Hi @pbsf Can you try this with the latest master again? I don't use windows, so not sure how to fix it. Probably we need to escape something in |
Hi @fatih, I'm not using vimproc. The Vim error message is:
Therefore it's not similar to #1013. I updated to master(d3c4fb3), and the error still happens. I'm using VIM 7.4 with LUA. Vim-go works just fine when I checkout the git hash 6e1072e. I read about the new features I'm eager to use it. Just let me know if you want me to run more tests. Thanks. |
I've doubled check the code of |
Anyone, please try this? diff --git a/autoload/go/def.vim b/autoload/go/def.vim
index 41464fe..725ffcc 100644
--- a/autoload/go/def.vim
+++ b/autoload/go/def.vim
@@ -25,7 +25,7 @@ function! go#def#Jump(mode)
let $GOPATH = old_gopath
return
endif
- let command = printf("%s -f=%s -o=%s -t", bin_path, fname, go#util#OffsetCursor())
+ let command = printf("%s -f=%s -o=%s -t", shellescape(bin_path), shellescape(fname), go#util#OffsetCursor())
let out = go#util#System(command)
" append the type information to the same line so our
@@ -59,7 +59,7 @@ function! go#def#Jump(mode)
endif
let fname = shellescape(fname.':#'.go#util#OffsetCursor())
- let command = printf("%s %s definition %s", bin_path, flags, fname)
+ let command = printf("%s %s definition %s", shellescape(bin_path), flags, shellescape(fname))
if &modified
let out = go#util#System(command, in) |
Oh I see, I think the diff --git a/autoload/go/def.vim b/autoload/go/def.vim
index bc226af..b72e8cc 100644
--- a/autoload/go/def.vim
+++ b/autoload/go/def.vim
@@ -71,6 +71,7 @@ function! go#def#Jump(mode) abort
return
endif
+ let cmd[0] = shellescape(cmd[0])
let command = join(cmd, " ")
if &modified
let out = go#util#System(command, stdin_content |
@pbsf, which environment are you running Vim in? It doesn't look like a native Windows build as it's calling I am currently working on getting vim-go to run in the shells provided by Git for Windows and MSYS2. The issue you are experiencing, in which the external tools cannot be called due to missing escaping, has not occurred in either of the two on my machine and the native Windows build worked well so far. In my case (in MSYS2 or Git Bash from Git for Windows), the command line tools are launched properly but receive command line arguments in Unix path notation, which does not work with the native windows binaries installed by My current work in progress branch is https://github.com/tdilo/vim-go/tree/fix-msys2 - I did some spot checks and most tools already work with the changes I made. I am trying to make sure that my changes work in
I still need to verify that I did not break Cygwin (does it actually work?) or anything else before opening a pull request in the next few days. In any case it's a huge combinatorial mess with all the slightly differing options to run Vim on Windows. EDIT: Git for Windows does ship Vim 8 by now. |
@fatih, adding both fixes solved my issue. Thanks a lot! Feel free to close the issue. |
Closed due @pbsf's comment |
I have been using vim-go on Windows for a while without any major issues. Today I decided to update my vim plugins (dumb me), and I started to receive the following when when calling
:GoDef
:The file is in
/c/tools/go/bin/guru.exe
, which means the slashes are not being used correctly on the Windows environment. Any tips on which file I should look into to fix this? I can provide a PR in case it works.VIM Version: 7.4
vim-go Version: 1.9 - d9fa1bc
Edit: On version 1.6 of vim-go I don't have this issue. From 1.7-1.9, I do.
The text was updated successfully, but these errors were encountered: