From 1c954f2cd69d985393ddac600dd6705cd7c40fcb Mon Sep 17 00:00:00 2001 From: Hardik Joshi Date: Tue, 9 Oct 2018 22:32:29 +0530 Subject: [PATCH 1/2] Use guibg instead of ctermbg for neovim --- autoload/go/statusline.vim | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/autoload/go/statusline.vim b/autoload/go/statusline.vim index e98d733055..acde2d7bcc 100644 --- a/autoload/go/statusline.vim +++ b/autoload/go/statusline.vim @@ -53,12 +53,22 @@ function! go#statusline#Show() abort " only update highlight if status has changed. if status_text != s:last_status - if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" - hi goStatusLineColor cterm=bold ctermbg=76 ctermfg=22 - elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" - hi goStatusLineColor cterm=bold ctermbg=208 ctermfg=88 - elseif status.state =~ "failed" - hi goStatusLineColor cterm=bold ctermbg=196 ctermfg=52 + if (has("nvim")) + if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" + hi goStatusLineColor cterm=bold guibg=#5fd700 guifg=#005f00 + elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" + hi goStatusLineColor cterm=bold guibg=#ff8700 guifg=#870000 + elseif status.state =~ "failed" + hi goStatusLineColor cterm=bold guibg=#ff0000 guifg=#5f0000 + endif + else + if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" + hi goStatusLineColor cterm=bold ctermbg=76 ctermfg=22 + elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" + hi goStatusLineColor cterm=bold ctermbg=208 ctermfg=88 + elseif status.state =~ "failed" + hi goStatusLineColor cterm=bold ctermbg=196 ctermfg=52 + endif endif endif From 3a669f0601e2ec3ecee8c20c234edf454d8e8cdb Mon Sep 17 00:00:00 2001 From: Hardik Joshi Date: Mon, 15 Oct 2018 19:25:11 +0530 Subject: [PATCH 2/2] Add guifb and guibg to hi instead of having separate if/else --- autoload/go/statusline.vim | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/autoload/go/statusline.vim b/autoload/go/statusline.vim index acde2d7bcc..78ad4726ec 100644 --- a/autoload/go/statusline.vim +++ b/autoload/go/statusline.vim @@ -53,22 +53,12 @@ function! go#statusline#Show() abort " only update highlight if status has changed. if status_text != s:last_status - if (has("nvim")) - if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" - hi goStatusLineColor cterm=bold guibg=#5fd700 guifg=#005f00 - elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" - hi goStatusLineColor cterm=bold guibg=#ff8700 guifg=#870000 - elseif status.state =~ "failed" - hi goStatusLineColor cterm=bold guibg=#ff0000 guifg=#5f0000 - endif - else - if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" - hi goStatusLineColor cterm=bold ctermbg=76 ctermfg=22 - elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" - hi goStatusLineColor cterm=bold ctermbg=208 ctermfg=88 - elseif status.state =~ "failed" - hi goStatusLineColor cterm=bold ctermbg=196 ctermfg=52 - endif + if status.state =~ "success" || status.state =~ "finished" || status.state =~ "pass" + hi goStatusLineColor cterm=bold ctermbg=76 ctermfg=22 guibg=#5fd700 guifg=#005f00 + elseif status.state =~ "started" || status.state =~ "analysing" || status.state =~ "compiling" + hi goStatusLineColor cterm=bold ctermbg=208 ctermfg=88 guibg=#ff8700 guifg=#870000 + elseif status.state =~ "failed" + hi goStatusLineColor cterm=bold ctermbg=196 ctermfg=52 guibg=#ff0000 guifg=#5f0000 endif endif