From aee03f324b1a0cc6d69f6c2657e7b029b63e3bec Mon Sep 17 00:00:00 2001 From: rwxguo <10892928+rwxguo@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:32:43 +0800 Subject: [PATCH 1/9] update --- autoload/go/path.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/go/path.vim b/autoload/go/path.vim index 6f96081228..d5ed5207a0 100644 --- a/autoload/go/path.vim +++ b/autoload/go/path.vim @@ -164,6 +164,10 @@ function! go#path#ToURI(path) let l:absolute = 1 let l:prefix = '/' . l:path[0:1] let l:path = l:path[2:] + elseif (system('uname') =~ 'MINGW' || system('uname') =~ 'CYGWIN') + let l:absolute = 1 + let l:prefix = l:path[0:1] . ':' + let l:path = l:path[2:3] is# ':/' ? l:path[3:] : l:path[2:] endif return substitute( From 50255c42117a7c6a7a22798b6c0c563f6425dd3a Mon Sep 17 00:00:00 2001 From: rwxguo <10892928+rwxguo@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:34:45 +0800 Subject: [PATCH 2/9] update --- autoload/go/def.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index 4cfb34b1e1..83299e2d99 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -126,6 +126,9 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort let out = split(final_out, go#util#LineEnding())[0] if go#util#IsWin() let parts = split(out, '\(^[a-zA-Z]\)\@ Date: Mon, 18 Dec 2023 13:22:33 +0800 Subject: [PATCH 3/9] update --- autoload/go/def.vim | 6 ++++-- autoload/go/lsp.vim | 11 ++++++++++- autoload/go/path.vim | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index 83299e2d99..eeee07d4f4 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -126,8 +126,10 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort let out = split(final_out, go#util#LineEnding())[0] if go#util#IsWin() let parts = split(out, '\(^[a-zA-Z]\)\@ Date: Mon, 18 Dec 2023 14:39:25 +0800 Subject: [PATCH 4/9] update --- autoload/go/lsp.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/go/lsp.vim b/autoload/go/lsp.vim index aa8e787b3a..ef7ec4008a 100644 --- a/autoload/go/lsp.vim +++ b/autoload/go/lsp.vim @@ -619,7 +619,7 @@ function! s:definitionHandler(next, msg) abort dict let l:msguri = go#path#FromURI(l:msg.uri) " remove the comma in cygwin unix-like windwos path " e.g. '/c:/path' to '/c/path' - if system('uname') =~ 'MINGW' || system('uname') =~ 'CYGWIN' + if has('win32unix') && (system('uname') =~ 'MINGW' || system('uname') =~ 'CYGWIN') if l:msguri[2:3] is# ':/' let l:msguri = l:msguri[0:1] . l:msguri[3:] endif From 3246e9ea09c6c2d82e25f5edb0067e1c1eef4ddd Mon Sep 17 00:00:00 2001 From: rwxguo <10892928+rwxguo@users.noreply.github.com> Date: Mon, 25 Dec 2023 10:55:56 +0800 Subject: [PATCH 5/9] update --- autoload/go/def.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index eeee07d4f4..6cf62f2644 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -127,7 +127,8 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort if go#util#IsWin() let parts = split(out, '\(^[a-zA-Z]\)\@ Date: Mon, 25 Dec 2023 13:54:11 +0000 Subject: [PATCH 6/9] update --- autoload/go/path.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autoload/go/path.vim b/autoload/go/path.vim index 08ba85d1db..d824a860f4 100644 --- a/autoload/go/path.vim +++ b/autoload/go/path.vim @@ -166,8 +166,13 @@ function! go#path#ToURI(path) let l:path = l:path[2:] elseif system('uname') =~ 'MINGW' || system('uname') =~ 'CYGWIN' let l:absolute = 1 - let l:prefix = l:path[0:1] . ':' - let l:path = l:path[2:3] is# ':/' ? l:path[3:] : l:path[2:] + if l:path[0:8] == '/cygdrive' + let l:prefix = l:path[9:10] . ':' + let l:path = l:path[11:] + else + let l:prefix = l:path[0:1] . ':' + let l:path = l:path[2:3] is# ':/' ? l:path[3:] : l:path[2:] + endif endif return substitute( From adc17518ae5838f7a1734d12d1b17903f2168eba Mon Sep 17 00:00:00 2001 From: rwxguo <10892928+rwxguo@users.noreply.github.com> Date: Mon, 25 Dec 2023 14:20:12 +0000 Subject: [PATCH 7/9] update --- autoload/go/def.vim | 11 +++++++---- autoload/go/lsp.vim | 13 +++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index 6cf62f2644..f5065b4423 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -124,12 +124,15 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort " strip line ending let out = split(final_out, go#util#LineEnding())[0] + if go#util#IsWin() let parts = split(out, '\(^[a-zA-Z]\)\@ Date: Mon, 25 Dec 2023 14:21:19 +0000 Subject: [PATCH 8/9] update --- autoload/go/def.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autoload/go/def.vim b/autoload/go/def.vim index f5065b4423..6fbf930ef5 100644 --- a/autoload/go/def.vim +++ b/autoload/go/def.vim @@ -129,10 +129,8 @@ function! go#def#jump_to_declaration(out, mode, bin_name) abort let parts = split(out, '\(^[a-zA-Z]\)\@ Date: Mon, 25 Dec 2023 14:36:48 +0000 Subject: [PATCH 9/9] update --- autoload/go/path.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/go/path.vim b/autoload/go/path.vim index d824a860f4..d501b39c9a 100644 --- a/autoload/go/path.vim +++ b/autoload/go/path.vim @@ -164,7 +164,7 @@ function! go#path#ToURI(path) let l:absolute = 1 let l:prefix = '/' . l:path[0:1] let l:path = l:path[2:] - elseif system('uname') =~ 'MINGW' || system('uname') =~ 'CYGWIN' + elseif has('win32unix') let l:absolute = 1 if l:path[0:8] == '/cygdrive' let l:prefix = l:path[9:10] . ':'