Skip to content

Commit

Permalink
fix(float): fix possible invalid foldcolumn
Browse files Browse the repository at this point in the history
Always set foldcolumn option for float window on neovim

Closes neoclide#4311
  • Loading branch information
chemzqm committed Oct 20, 2022
1 parent 72d6274 commit a548722
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions autoload/coc/float.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1324,9 +1324,7 @@ function! s:set_float_defaults(winid, config) abort
call setwinvar(a:winid, '&winhl', 'Normal:'.hlgroup.',FoldColumn:'.hlgroup.',Search:')
call setwinvar(a:winid, 'border', get(a:config, 'border', []))
call setwinvar(a:winid, 'scrollinside', get(a:config, 'scrollinside', 0))
if !get(a:config, 'nopad', 0)
call setwinvar(a:winid, '&foldcolumn', s:nvim_enable_foldcolumn(get(a:config, 'border', v:null)))
endif
call setwinvar(a:winid, '&foldcolumn', s:nvim_get_foldcolumn(a:config))
call setwinvar(a:winid, '&signcolumn', 'no')
call setwinvar(a:winid, '&cursorcolumn', 0)
else
Expand Down Expand Up @@ -1379,11 +1377,13 @@ function! s:nvim_add_related(winid, target, kind, winhl, related) abort
call add(a:related, a:winid)
endfunction

function! s:nvim_enable_foldcolumn(border) abort
if a:border is 1
function! s:nvim_get_foldcolumn(config) abort
let nopad = get(a:config, 'nopad', 0)
if nopad
return 0
endif
if type(a:border) == v:t_list && get(a:border, 3, 0) == 1
let border = get(a:config, 'border', v:null)
if border is 1 || (type(border) == v:t_list && get(border, 3, 0) == 1)
return 0
endif
return 1
Expand Down

0 comments on commit a548722

Please sign in to comment.