From: shane.xb.qian Date: Fri, 14 Apr 2023 07:22:43 +0000 (+0800) Subject: fix: resolve symlink in case X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ee12d320a1c65320f37c96223c2b770d9a49f2b0;p=vim-lsp.git fix: resolve symlink in case --- diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 69baa9c..9a71ed3 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -155,12 +155,12 @@ def InitServer(lspserver: dict, bnr: number) # Compute the rootpath (based on the directory of the buffer) var rootPath = '' var rootSearchFiles = lspserver.rootSearchFiles - var bufDir = bnr->bufname()->fnamemodify(':p:h') + var bufDir = bnr->bufname()->resolve()->fnamemodify(':p:h') if !rootSearchFiles->empty() rootPath = util.FindNearestRootDir(bufDir, rootSearchFiles) endif if rootPath == '' - var cwd = getcwd() + var cwd = getcwd()->resolve() # bufDir is within cwd var bufDirPrefix = bufDir[0 : cwd->strcharlen() - 1]