]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Style changes
authorPeter Jankuliak <p.jankuliak@gmail.com>
Tue, 9 May 2023 06:37:35 +0000 (07:37 +0100)
committerPeter Jankuliak <p.jankuliak@gmail.com>
Tue, 9 May 2023 06:37:35 +0000 (07:37 +0100)
autoload/lsp/util.vim

index 172704d2e05c688bc37f6d8719ec39744fc03096..bb783d33b60179a45155918efe2a7264770fc4ab 100644 (file)
@@ -141,13 +141,17 @@ enddef
 # Convert POSIX paths as used in Cygwin to native Windows paths
 def CygwinToWindowsPath(path: string): string
   if path =~? '^\/cygdrive\/'
-    # Convert paths of the form "/cygdrive/c/foo/bar" to "C:/foo/bar"
-    return substitute(path, '^\/cygdrive\/\(\a\)\/', '\=submatch(1) .. ":/"', "")
+    # Convert paths of the form "/cygdrive/c/foo/bar" to "c:/foo/bar"
+
+    return path->substitute('^\/cygdrive\/\(\a\)\/', '\=submatch(1) .. ":/"', "")
   elseif path =~? '^\/'
     # Convert paths of the form "/home/pete/foo" to "C:/cygwin64/home/pete/foo"
-    if len(g:cygwinroot) == 0
+
+    if g:cygwinroot->len() == 0
       # https://stackoverflow.com/a/7449029/273348
-      g:cygwinroot = substitute(system("reg query HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Cygwin\\\\setup /v rootdir | grep rootdir"),
+      var query: string = "reg query HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Cygwin\\\\setup /v rootdir | grep rootdir"
+
+      g:cygwinroot = system(query)->substitute(
             \ '^\s*\S\+\s\+\S\+\s\+\(\p\+\).*$',
             \ '\=submatch(1)',
             \ "")