File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -285,14 +285,15 @@ function! OmniSharp#util#TranslatePathForClient(filename) abort
285
285
if modifiers == # ' relative'
286
286
let filename = fnamemodify (filename, ' :p' )
287
287
let common = escape (getcwd (), ' \' )
288
- let result = ' '
289
- while substitute (filename, common . s: dir_separator , ' ' , ' ' ) == # filename
290
- \ && common !=# fnamemodify (common, ' :h' )
288
+ let relpath = substitute (filename, ' ^ ' . common . s: dir_separator , ' ' , ' ' )
289
+ let relprefix = ' '
290
+ while relpath == # filename && common !=# fnamemodify (common, ' :h' )
291
291
let common = fnamemodify (common, ' :h' )
292
- let result .= ' ..' . s: dir_separator
292
+ let relpath = substitute (filename, ' ^' . common . s: dir_separator , ' ' , ' ' )
293
+ let relprefix .= ' ..' . s: dir_separator
293
294
endwhile
294
295
if common !=# fnamemodify (common, ' :h' )
295
- return result . substitute (filename, common . s: dir_separator , ' ' , ' ' )
296
+ return relprefix . relpath
296
297
endif
297
298
let modifiers = ' :p'
298
299
endif
You can’t perform that action at this time.
0 commit comments