From 6b03f8809dc7c2c7b3465935a051528f4cfaa0cf Mon Sep 17 00:00:00 2001 From: Peter Jankuliak Date: Mon, 29 May 2023 07:33:50 +0100 Subject: [PATCH] Minor refactor --- autoload/lsp/util.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 2b157de..a02f655 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -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 -- 2.48.1