-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The color did not display well when inactivate the terminal window #2305
Comments
I am not quite sure what is causing this. It could be that you have the order of overwriting operations wrong or that you are copying a reference to a map somewhere. For reference you can have a look how I set up mine, because that one works: https://github.com/kmoschcau/nvim-config/blob/master/autoload/airline/themes/material.vim |
I had a similar problem to yours while using the gruvbox colorscheme and managed to fix it by using the patch described in vim-airline/vim-airline-themes#180, maybe it will help you as well. |
TL;DR: The thing with OP's patch is, airline does not use the added Explained: According to documentation in airline's default theme dark.vim, a vim buffer's mode is one of For a vim terminal window, when the job running inside it receives user's keystrokes, airline recognizes the window as in And then comes the "bash name field", corresponding to the code line OP has commented out to make things work. The line sits in a function which "builds" the statusline section by section, and the line itself adds a section displaying the job's name, employing highlight group So to fix the green-on-black display, the key is to get The vimrc patch in vim-airline/vim-airline-themes#180 does work for most cases, yet on my computer the terminal window's Another straightforward way, apparently, is to manually add proper function! airline#themes#solarized#refresh()
... " Existing code
" Fix terminal window
" For 'terminal' mode, derive from 'insert' mode
let g:airline#themes#solarized#palette.terminal = airline#themes#generate_color_map(
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
" Add 'airline_term' highlight group
" Treat it as an equivalent of 'airline_c'
let g:airline#themes#solarized#palette.terminal.airline_term =
\ g:airline#themes#solarized#palette.terminal.airline_c
" 'Terminal-Normal' as 'normal_modified'
let g:airline#themes#solarized#palette.normal_modified.airline_term =
\ g:airline#themes#solarized#palette.normal_modified.airline_c
" 'Visual' as 'visual_modified'
let g:airline#themes#solarized#palette.visual_modified.airline_term =
\ g:airline#themes#solarized#palette.visual_modified.airline_c
" 'inactive' is somewhat awkward, involving both 'inactive' & 'inactive_modified'
let g:airline#themes#solarized#palette.inactive_modified.airline_term =
\ g:airline#themes#solarized#palette.inactive_modified.airline_c
let g:airline#themes#solarized#palette.inactive.airline_term =
\ g:airline#themes#solarized#palette.inactive.airline_c
endfunction One should be able to fix an arbitrary airline theme's terminal window statusline headache in a similar manner. |
I improved the scheme solarized to support the terminal mode by referring to vim-airline/vim-airline-themes#225 and vim-airline/vim-airline-themes#235. After I fixed the issue, all works fine except that when inactivate the terminal window, the "bash name field" show a black line as shown in the actual screenshot below.
After some debug, i found when i commented out the below code, it works well.
Below is my modification for the solarized scheme where i set the "airline_term" the same as "airline_c" in inactive mode(which is not work):
I'm newbie to the vimscript, so i don't know what's the root cause.
cc @kmoschcau
environment
if you are using terminal:
if you are using Neovim:
actual behavior
expected behavior
screen shot (if possible)
The text was updated successfully, but these errors were encountered: