@@ -80,6 +80,12 @@ endfunction
80
80
function s: CloseLast (redraw ) abort
81
81
if exists (' s:lastwinid' )
82
82
if has (' nvim' )
83
+ try
84
+ let options = s: nvim_window_options [s: lastwinid ]
85
+ for opt in keys (options )
86
+ call nvim_win_set_option (s: lastwinid , opt , s: nvim_window_options [s: lastwinid ][opt ])
87
+ endfor
88
+ catch | endtry
83
89
call nvim_win_close (s: lastwinid , v: true )
84
90
if exists (' #OmniSharp_nvim_popup' )
85
91
autocmd ! OmniSharp_nvim_popup
@@ -155,20 +161,20 @@ function s:NvimGetOptions() abort
155
161
endfunction
156
162
157
163
function ! s: NvimOpen (what, opts) abort
164
+ let config = {
165
+ \ ' focusable' : v: false
166
+ \}
158
167
if type (a: what ) == v: t_number
159
168
let bufnr = a: what
160
169
let lines = getbufline (bufnr , 1 , ' $' )
161
170
else
162
171
let bufnr = nvim_create_buf (v: false , v: true )
163
172
call setbufline (bufnr , 1 , a: what )
164
173
let lines = a: what
174
+ let config.style = ' minimal'
165
175
endif
166
176
let content_height = len (lines )
167
177
let position = get (g: , ' OmniSharp_popup_position' , ' atcursor' )
168
- let config = {
169
- \ ' focusable' : v: false ,
170
- \ ' style' : ' minimal'
171
- \}
172
178
" Positions 'peek' and 'full' only apply to file buffers, not documentation
173
179
" buffers
174
180
if type (a: what ) == v: t_number && position == ? ' peek'
@@ -198,8 +204,13 @@ function! s:NvimOpen(what, opts) abort
198
204
let s: parentwinid = win_getid (winnr ())
199
205
let winid = nvim_open_win (bufnr , v: false , config)
200
206
let options = s: NvimGetOptions ()
207
+ let s: nvim_window_options = get (s: , ' nvim_window_options' , {})
208
+ let s: nvim_window_options [winid] = {}
201
209
for opt in keys (options )
202
- call nvim_win_set_option (winid, opt , options [opt ])
210
+ if nvim_win_get_option (winid, opt ) != options [opt ]
211
+ let s: nvim_window_options [winid][opt ] = nvim_win_get_option (winid, opt )
212
+ call nvim_win_set_option (winid, opt , options [opt ])
213
+ endif
203
214
endfor
204
215
call nvim_set_current_win (winid)
205
216
if exists (' calculatingHeight' )
0 commit comments