From e71c3ebcfcb09853c37118ed1ddc06587dcd4f9c Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Tue, 9 Feb 2016 18:35:56 -0500 Subject: [PATCH 1/2] Set highlight groups for terminal mode in lightline#highlight() Fixes #144. I just added the missing terminal mode to modes in lightline#highlight() if neovim is being used. --- autoload/lightline.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index dd43078..f6afcf9 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -217,7 +217,7 @@ function! lightline#highlight(...) abort let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)] let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(c,'tabline') && has_key(c.tabline, 'left') ? c.tabline.left : c.normal.left), len(has_key(c,'tabline') && has_key(c.tabline, 'right') ? c.tabline.right : c.normal.right)] let h = s:uniq(filter(copy(values(g)), 'v:val !=# "raw"')) - let modes = a:0 ? [a:1] : ['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'] + let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : []) for mode in modes let s:highlight[mode] = 1 let d = has_key(c, mode) ? mode : has_key(f, mode) && has_key(c, f[mode]) ? f[mode] : 'normal' From 6e60201371aaa4d6977fc8c0b43a977103fc0727 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Tue, 9 Feb 2016 20:51:00 -0500 Subject: [PATCH 2/2] No need to run has('win64') after has('win32') has('win32') includes 64bit windows thus it is pointless to run has('win64') afterwards. --- autoload/lightline.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index f6afcf9..656f7ad 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -207,7 +207,7 @@ endfunction function! lightline#highlight(...) abort let [c, f, g] = [s:lightline.palette, s:lightline.mode_fallback, s:lightline.component_type] - if (has('win32') || has('win64')) && !has('gui_running') && &t_Co < 256 + if has('win32') && !has('gui_running') && &t_Co < 256 for u in values(c) for v in values(u) for _ in v | let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])] | endfor