@@ -174,18 +174,6 @@ function! OmniSharp#stdio#Request(command, opts) abort
174
174
\ fnamemodify (bufname (bufnr ), ' :p' ))
175
175
let send_buffer = get (a: opts , ' SendBuffer' , 1 )
176
176
endif
177
- let lines = getbufline (bufnr , 1 , ' $' )
178
- if has_key (a: opts , ' OverrideBuffer' )
179
- let lines [a: opts .OverrideBuffer.LineNr - 1 ] = a: opts .OverrideBuffer.Line
180
- let cnum = a: opts .OverrideBuffer.Col
181
- endif
182
- let tmp = join (lines , ' ' )
183
- " Unique string separator which must not exist in the buffer
184
- let sep = ' @' . matchstr (reltimestr (reltime ()), ' \v\.@<=\d+' ) . ' @'
185
- while stridx (tmp, sep) >= 0
186
- let sep = ' @' . matchstr (reltimestr (reltime ()), ' \v\.@<=\d+' ) . ' @'
187
- endwhile
188
- let buffer = join (lines , sep)
189
177
190
178
let body = {
191
179
\ ' Arguments' : {
@@ -195,7 +183,20 @@ function! OmniSharp#stdio#Request(command, opts) abort
195
183
\ }
196
184
\}
197
185
if send_buffer
198
- let body.Arguments .Buffer = buffer
186
+ let lines = getbufline (bufnr , 1 , ' $' )
187
+ if has_key (a: opts , ' OverrideBuffer' )
188
+ let lines [a: opts .OverrideBuffer.LineNr - 1 ] = a: opts .OverrideBuffer.Line
189
+ let cnum = a: opts .OverrideBuffer.Col
190
+ endif
191
+ let tmp = join (lines , ' ' )
192
+ " Unique string separator which must not exist in the buffer
193
+ let sep = ' @' . matchstr (reltimestr (reltime ()), ' \v\.@<=\d+' ) . ' @'
194
+ while stridx (tmp, sep) >= 0
195
+ let sep = ' @' . matchstr (reltimestr (reltime ()), ' \v\.@<=\d+' ) . ' @'
196
+ endwhile
197
+ let body.Arguments .Buffer = join (lines , sep)
198
+ else
199
+ let sep = ' '
199
200
endif
200
201
201
202
call s: Request (job, body, a: command , a: opts , sep)
0 commit comments