Skip to content

Commit 76c93e1

Browse files
committed
Unset window-local window options on popup close
Fixes #739
1 parent 9439b36 commit 76c93e1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

autoload/OmniSharp/popup.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ endfunction
8080
function s:CloseLast(redraw) abort
8181
if exists('s:lastwinid')
8282
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
8389
call nvim_win_close(s:lastwinid, v:true)
8490
if exists('#OmniSharp_nvim_popup')
8591
autocmd! OmniSharp_nvim_popup
@@ -198,7 +204,10 @@ function! s:NvimOpen(what, opts) abort
198204
let s:parentwinid = win_getid(winnr())
199205
let winid = nvim_open_win(bufnr, v:false, config)
200206
let options = s:NvimGetOptions()
207+
let s:nvim_window_options = get(s:, 'nvim_window_options', {})
208+
let s:nvim_window_options[winid] = {}
201209
for opt in keys(options)
210+
let s:nvim_window_options[winid][opt] = nvim_win_get_option(winid, opt)
202211
call nvim_win_set_option(winid, opt, options[opt])
203212
endfor
204213
call nvim_set_current_win(winid)

0 commit comments

Comments
 (0)