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.
This commit is contained in:
Anmol Sethi
2016-02-09 18:35:56 -05:00
parent b6a43c0ec3
commit e71c3ebcfc

View File

@@ -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'