From ef3746d02266c4630e2658ad2302b266f53a0434 Mon Sep 17 00:00:00 2001 From: Andrea Schiavini Date: Fri, 5 Feb 2016 09:19:31 +0100 Subject: [PATCH] Neovim support --- autoload/airline/builder.vim | 2 +- autoload/airline/extensions/tabline.vim | 2 +- autoload/airline/highlighter.vim | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/airline/builder.vim b/autoload/airline/builder.vim index a1f0b3eb..6e2a0e5c 100644 --- a/autoload/airline/builder.vim +++ b/autoload/airline/builder.vim @@ -77,7 +77,7 @@ function! s:should_change_group(group1, group2) endif let color1 = airline#highlighter#get_highlight(a:group1) let color2 = airline#highlighter#get_highlight(a:group2) - if has('gui_running') || (has("termtruecolor") && &guicolors == 1) + if has('gui_running') || has('nvim') || (has("termtruecolor") && &guicolors == 1) return color1[1] != color2[1] || color1[0] != color2[0] else return color1[3] != color2[3] || color1[2] != color2[2] diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 8f2f9591..b0d5eee8 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -12,7 +12,7 @@ endif function! airline#extensions#tabline#init(ext) - if has('gui_running') + if has('nvim') || has('gui_running') set guioptions-=e endif diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index 70beb624..c586978f 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -18,13 +18,13 @@ endfunction function! s:get_syn(group, what) " need to pass in mode, known to break on 7.3.547 - let mode = has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm' + let mode = has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1) ? 'gui' : 'cterm' let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode) if empty(color) || color == -1 let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode) endif if empty(color) || color == -1 - if has('gui_running') || (has("termtruecolor") && &guicolors == 1) + if has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1) let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF' else let color = a:what ==# 'fg' ? 0 : 1 @@ -36,7 +36,7 @@ endfunction function! s:get_array(fg, bg, opts) let fg = a:fg let bg = a:bg - return has('gui_running') || (has("termtruecolor") && &guicolors == 1) + return has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1) \ ? [ fg, bg, '', '', join(a:opts, ',') ] \ : [ '', '', fg, bg, join(a:opts, ',') ] endfunction @@ -44,7 +44,7 @@ endfunction function! airline#highlighter#get_highlight(group, ...) let fg = s:get_syn(a:group, 'fg') let bg = s:get_syn(a:group, 'bg') - let reverse = has('gui_running') || (has("termtruecolor") && &guicolors == 1) + let reverse = has('nvim') || has('gui_running') || (has("termtruecolor") && &guicolors == 1) \ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') \ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') \|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')