autoload/lsp/util.vim | 6 +++--- diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index f9add18ded704c62edb0603225eb77d2abf826ec..b9cb13844374fa5167187c98c5ff6a993d9b0acf 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -112,9 +112,9 @@ export def LspFileToUri(fname: string): string var uri: string = fname->fnamemodify(':p') if has("win32unix") - # We're in Cygwin, we need to convert POSIX style paths to Windows style. - # `cygpath -m` converts paths of the form "/cygdrive/c/foo/bar" to "C:/foo/bar", and - # paths of the form "/home/pete/foo" to "C:/cygwin64/home/pete/foo". + # We're in Cygwin, convert POSIX style paths to Windows style. + # The substitution is to remove the '^@' escape character from the end of + # line. uri = system($'cygpath -m {uri}')->substitute('^\(\p*\).*$', '\=submatch(1)', "") endif