Skip to content

Commit a78ec04

Browse files
committed
Do not modify filenames before navigate/preview
1 parent 1cc36a2 commit a78ec04

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

autoload/OmniSharp/actions/definition.vim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ function! s:CBGotoDefinition(opts, location, metadata) abort
7878
let found = 0
7979
endif
8080
else
81-
let location = OmniSharp#locations#Modify(a:location)
82-
let found = OmniSharp#locations#Navigate(location, a:opts.editcommand)
81+
let found = OmniSharp#locations#Navigate(a:location, a:opts.editcommand)
8382
endif
8483
if has_key(a:opts, 'Callback') && !went_to_metadata
8584
call a:opts.Callback(found)
@@ -97,9 +96,8 @@ function! s:CBPreviewDefinition(opts, location, metadata) abort
9796
echo 'Not found'
9897
endif
9998
else
100-
let location = OmniSharp#locations#Modify(a:location)
101-
call OmniSharp#locations#Preview(location)
102-
echo fnamemodify(a:location.filename, ':.')
99+
call OmniSharp#locations#Preview(a:location)
100+
echo OmniSharp#locations#Modify(a:location).filename
103101
endif
104102
endfunction
105103

autoload/OmniSharp/actions/implementations.vim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ function! s:CBFindImplementations(target, opts, locations) abort
4949
if numImplementations == 0
5050
echo 'No implementations found'
5151
elseif numImplementations == 1
52-
let location = OmniSharp#locations#Modify(a:locations[0])
53-
call OmniSharp#locations#Navigate(location)
52+
call OmniSharp#locations#Navigate(a:locations[0])
5453
else " numImplementations > 1
5554
let locations = OmniSharp#locations#Modify(a:locations)
5655
call OmniSharp#locations#SetQuickfix(locations,
@@ -67,12 +66,12 @@ function! s:CBPreviewImplementation(locations, ...) abort
6766
if numImplementations == 0
6867
echo 'No implementations found'
6968
else
70-
let location = OmniSharp#locations#Modify(a:locations[0])
71-
call OmniSharp#locations#Preview(location)
69+
call OmniSharp#locations#Preview(a:locations[0])
70+
let filename = OmniSharp#locations#Modify(a:locations[0]).filename
7271
if numImplementations == 1
73-
echo location.filename
72+
echo filename
7473
else
75-
echo location.filename . ': Implementation 1 of ' . numImplementations
74+
echo filename . ': Implementation 1 of ' . numImplementations
7675
endif
7776
endif
7877
endfunction

0 commit comments

Comments
 (0)