File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
1
let s: save_cpo = &cpoptions
2
2
set cpoptions &vim
3
3
4
- function ! OmniSharp#locations#Navigate (location, noautocmds ) abort
4
+ function ! OmniSharp#locations#Navigate (location, silentedit ) abort
5
5
if a: location .filename !=# ' '
6
6
" Update the ' mark, adding this location to the jumplist.
7
7
normal ! m '
8
8
if fnamemodify (a: location .filename, ' :p' ) !=# expand (' %:p' )
9
- execute
10
- \ (a: noautocmds ? ' noautocmd' : ' ' )
11
- \ (&modified && ! &hidden ? ' split' : get (g: , ' OmniSharp_edit_command' , ' edit' ))
12
- \ fnameescape (a: location .filename)
9
+ let editcommand = get (g: , ' OmniSharp_edit_command' , ' edit' )
10
+ if a: silentedit
11
+ let editcommand = ' edit'
12
+ endif
13
+ if &modified && ! &hidden && editcommand == # ' edit'
14
+ let editcommand = ' split'
15
+ endif
16
+ if a: silentedit
17
+ let editcommand = ' noautocmd ' . editcommand
18
+ endif
19
+ execute editcommand fnameescape (a: location .filename)
13
20
endif
14
21
if get (a: location , ' lnum' , 0 ) > 0
15
22
let col = get (a: location , ' vcol' , 0 )
Original file line number Diff line number Diff line change 17
17
ctx = VimUtilCtx (vim )
18
18
19
19
20
- def openFile (filename , line = 0 , column = 0 , noautocmd = 0 ):
20
+ def openFile (filename , line = 0 , column = 0 , silentedit = 0 ):
21
21
vim .command ("let l:loc = {{ 'filename': '{0}', 'lnum': {1}, 'col': {2} }}"
22
22
.format (filename , line , column ))
23
- vim .command ("call OmniSharp#locations#Navigate(l:loc, {0})" .format (noautocmd ))
23
+ vim .command ("call OmniSharp#locations#Navigate(l:loc, {0})" .format (silentedit ))
24
24
25
25
26
26
def setBuffer (text ):
@@ -130,7 +130,7 @@ def runCodeAction(mode, action):
130
130
vim .command ('let l:hidden_bak = &hidden | set hidden' )
131
131
for changeDefinition in changes :
132
132
filename = formatPathForClient (ctx , changeDefinition ['FileName' ])
133
- openFile (filename , noautocmd = 1 )
133
+ openFile (filename , silentedit = 1 )
134
134
if not setBuffer (changeDefinition .get ('Buffer' )):
135
135
for change in changeDefinition .get ('Changes' , []):
136
136
setBuffer (change .get ('NewText' ))
You can’t perform that action at this time.
0 commit comments