]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Minor refactor
authorPeter Jankuliak <p.jankuliak@gmail.com>
Mon, 29 May 2023 06:33:50 +0000 (07:33 +0100)
committerPeter Jankuliak <p.jankuliak@gmail.com>
Mon, 29 May 2023 06:33:50 +0000 (07:33 +0100)
autoload/lsp/util.vim

index 2b157de1edea4de98ad9cfb6201e07d06e9e8d3a..a02f6556b176663974363f95893ca0482937dc79 100644 (file)
@@ -117,15 +117,13 @@ export def LspFileToUri(fname: string): string
     return resolvedUris[fname_full]
   endif
 
-  var uri: string
+  var uri: string = fname_full
 
   if has("win32unix")
     # 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 {fname_full}')->substitute('^\(\p*\).*$', '\=submatch(1)', "")
-  else
-    uri = fname_full
+    uri = system($'cygpath -m {uri}')->substitute('^\(\p*\).*$', '\=submatch(1)', "")
   endif
 
   var on_windows: bool = false