Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set guibg when termguicolors is enabled? #78

Open
damnskippy opened this issue Jan 1, 2023 · 0 comments
Open

set guibg when termguicolors is enabled? #78

damnskippy opened this issue Jan 1, 2023 · 0 comments

Comments

@damnskippy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant