Always set background colour when running gui (#76)

Setting 'g:dracula_colorterm' to '0' to get a transparent background in the terminal also sets the gui background to 'none' and breaks gvim. (The gvim background ends up white).

Changed the call to the Normal highlight group to always set the background colour if the gui is running, regardless of the terminal setting.
This commit is contained in:
David Ben Knoble 2018-04-29 15:50:19 +02:00 committed by GitHub
commit 8b5afedeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,6 +156,14 @@ function! s:h(scope, fg, ...) " bg, attr_list, special
execute join(l:hl_string, ' ') execute join(l:hl_string, ' ')
endfunction endfunction
function! s:Background()
if g:dracula_colorterm || has("gui_running")
return s:bg
else
return s:none
endif
endfunction
"}}}2 "}}}2
" Dracula Highlight Groups: {{{2 " Dracula Highlight Groups: {{{2
@ -225,7 +233,7 @@ call s:h('DraculaDiffDelete', s:red, s:bgdark)
" Core: {{{2 " Core: {{{2
set background=dark set background=dark
call s:h('Normal', s:fg, g:dracula_colorterm == 1 ? s:bg : s:none) call s:h('Normal', s:fg, s:Background())
hi! link Visual DraculaSelection hi! link Visual DraculaSelection
hi! link VisualNOS Visual hi! link VisualNOS Visual