Skip to content

Commit 1c2095d

Browse files
committed
Ensure un-related paths can be resolved
1 parent 6c80e82 commit 1c2095d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autoload/OmniSharp/util.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ function! OmniSharp#util#TranslatePathForClient(filename) abort
283283
let common = escape(getcwd(), '\')
284284
let result = ''
285285
while substitute(filename, common . s:dir_separator, '', '') ==# filename
286+
\ && common !=# s:dir_separator
286287
let common = fnamemodify(common, ':h')
287288
let result .= '..' . s:dir_separator
288289
endwhile
289-
return result . substitute(filename, common . s:dir_separator, '', '')
290+
if common !=# s:dir_separator
291+
return result . substitute(filename, common . s:dir_separator, '', '')
292+
endif
290293
endif
291294

292295
return fnamemodify(filename, modifiers)

0 commit comments

Comments
 (0)