Skip to content

set guibg when termguicolors is enabled? #78

@damnskippy

Description

@damnskippy

With termguicolors enabled, vim will utilize highlight-guifg and highlight-guibg even in the terminal (overriding cterm settings) with true color support. However the following conditional prevents this because has(gui_running) evaluates to 0 in terminal.

if !has("gui_running") || g:falcon_background == 0

If this were to be changed as below it would support setting the guibg for Normal text as well. I have this change and it helps, so thought I'd mention here, not sure if this makes sense. If there is an issue doing this that I'm not seeing, perhaps another option is to have a user g:variable to force this, but this only as a secondary option and only if the change below is not feasible somehow.

diff --git a/plugin/falcon.vim b/plugin/falcon.vim
index 09552e8..b5b7e84 100644
--- a/plugin/falcon.vim
+++ b/plugin/falcon.vim
@@ -37,7 +37,7 @@ function s:HandleInactiveBackground()
     let g:falcon_background=1
   endif

-  if !has("gui_running") || g:falcon_background == 0
+  if (!has("gui_running") && !has('termguicolors')) || g:falcon_background == 0
     hi NonText guifg=#36363a ctermfg=237 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
     hi Normal guifg=#b4b4b9 ctermfg=249 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
   else

The above is moot if the user also has terminal theme set to falcon, but is relevant in cases the terminal theme is not set to falcon (as in my use case) but vim is set to use falcon theme.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions