From 6a0163104adb658cd14aa78599804d982be911b5 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Wed, 14 Aug 2013 03:53:29 +0000 Subject: [PATCH] unbreak csv extension. redefine gutter as the middle. --- autoload/airline.vim | 6 ++---- autoload/airline/extensions/csv.vim | 22 +++++++++++++++------- plugin/airline.vim | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index cb5aab1c..b8c074a8 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -89,14 +89,12 @@ function! airline#get_statusline(winnr, active) let sl.=l:info_sep_color let sl.=g:airline_left_sep let sl.=l:status_color.'%<'.s:get_section(a:winnr, 'c') - let sl.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)".l:status_color - let sl.=s:get_section(a:winnr, 'gutter', '', '') - let sl.=l:status_color + let sl.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)" else let sl.=l:status_color.' %f%m' endif + let sl.=l:status_color.s:get_section(a:winnr, 'gutter', '', '').l:status_color if s:getwinvar(a:winnr, 'airline_render_right', 1) - let sl.='%=' let sl.=s:get_section(a:winnr, 'x') let sl.=l:info_sep_color let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep diff --git a/autoload/airline/extensions/csv.vim b/autoload/airline/extensions/csv.vim index b14a30a0..c1de708b 100644 --- a/autoload/airline/extensions/csv.vim +++ b/autoload/airline/extensions/csv.vim @@ -5,18 +5,26 @@ if !exists('g:airline#extensions#csv#column_display') let g:airline#extensions#csv#column_display = 'Number' endif -function! airline#extensions#csv#apply() - if &ft ==# "csv" && exists("*CSV_WCol") - if get(g:, 'airline#extensions#csv#column_display', '') ==# 'Name' - let column = '['.CSV_WCol('Name').CSV_WCol().']' +function! airline#extensions#csv#get_statusline() + if exists('*CSV_WCol') + if g:airline#extensions#csv#column_display ==# 'Name' + return '['.CSV_WCol('Name').CSV_WCol().']' else - let column = '['.CSV_WCol().']' + return '['.CSV_WCol().']' endif + endif + return '' +endfunction +function! airline#extensions#csv#apply() + if &ft ==# "csv" if !exists('w:airline_section_gutter') - let w:airline_section_gutter = '' + let w:airline_section_gutter = '%=' endif - let w:airline_section_gutter .= g:airline_left_alt_sep.' '.column + let w:airline_section_gutter = + \ g:airline_left_alt_sep + \ .' %{airline#extensions#csv#get_statusline()}' + \ .w:airline_section_gutter endif endfunction diff --git a/plugin/airline.vim b/plugin/airline.vim index 65f96b52..56ba33d9 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -54,7 +54,7 @@ call s:check_defined('g:airline_mode_map', { call s:check_defined('g:airline_section_a', '%{get(w:, "airline_current_mode", "")}') call s:check_defined('g:airline_section_b', '%{get(w:, "airline_current_branch", "")}') call s:check_defined('g:airline_section_c', '%f%m') -call s:check_defined('g:airline_section_gutter', '') +call s:check_defined('g:airline_section_gutter', '%=') call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}") call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}") call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')