]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Fix util#LspUriToFile with handler#processDocSymbolReply
authorIndelog <maxime@indelog.fr>
Mon, 8 Nov 2021 14:25:22 +0000 (15:25 +0100)
committerIndelog <maxime@indelog.fr>
Thu, 11 Nov 2021 14:51:28 +0000 (15:51 +0100)
When get handler#processDocSymbol, textDocument.uri does not begin with
'file://', so util#LspUriToFile truncate the file name.

autoload/util.vim

index 54c334eae263165c1b3a1e31b51cbe8831a2ad65..38ece443b8524de84ccda0eec4df019d9c4ee12b 100644 (file)
@@ -56,7 +56,8 @@ export def LspUriToFile(uri: string): string
     # MS-Windows URI
     uri_decoded = uri_decoded[8 : ]
     uri_decoded = uri_decoded->substitute('/', '\\', 'g')
-  else
+  # On GNU/Linux (pattern not end with `:`)
+  elseif uri_decoded =~? '^file:///\a'
     uri_decoded = uri_decoded[7 : ]
   endif