mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
unbreak csv extension. redefine gutter as the middle.
This commit is contained in:
parent
b7131d8b51
commit
6a0163104a
@ -89,14 +89,12 @@ function! airline#get_statusline(winnr, active)
|
|||||||
let sl.=l:info_sep_color
|
let sl.=l:info_sep_color
|
||||||
let sl.=g:airline_left_sep
|
let sl.=g:airline_left_sep
|
||||||
let sl.=l:status_color.'%<'.s:get_section(a:winnr, 'c')
|
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.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)"
|
||||||
let sl.=s:get_section(a:winnr, 'gutter', '', '')
|
|
||||||
let sl.=l:status_color
|
|
||||||
else
|
else
|
||||||
let sl.=l:status_color.' %f%m'
|
let sl.=l:status_color.' %f%m'
|
||||||
endif
|
endif
|
||||||
|
let sl.=l:status_color.s:get_section(a:winnr, 'gutter', '', '').l:status_color
|
||||||
if s:getwinvar(a:winnr, 'airline_render_right', 1)
|
if s:getwinvar(a:winnr, 'airline_render_right', 1)
|
||||||
let sl.='%='
|
|
||||||
let sl.=s:get_section(a:winnr, 'x')
|
let sl.=s:get_section(a:winnr, 'x')
|
||||||
let sl.=l:info_sep_color
|
let sl.=l:info_sep_color
|
||||||
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
|
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep
|
||||||
|
@ -5,18 +5,26 @@ if !exists('g:airline#extensions#csv#column_display')
|
|||||||
let g:airline#extensions#csv#column_display = 'Number'
|
let g:airline#extensions#csv#column_display = 'Number'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! airline#extensions#csv#apply()
|
function! airline#extensions#csv#get_statusline()
|
||||||
if &ft ==# "csv" && exists("*CSV_WCol")
|
if exists('*CSV_WCol')
|
||||||
if get(g:, 'airline#extensions#csv#column_display', '') ==# 'Name'
|
if g:airline#extensions#csv#column_display ==# 'Name'
|
||||||
let column = '['.CSV_WCol('Name').CSV_WCol().']'
|
return '['.CSV_WCol('Name').CSV_WCol().']'
|
||||||
else
|
else
|
||||||
let column = '['.CSV_WCol().']'
|
return '['.CSV_WCol().']'
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! airline#extensions#csv#apply()
|
||||||
|
if &ft ==# "csv"
|
||||||
if !exists('w:airline_section_gutter')
|
if !exists('w:airline_section_gutter')
|
||||||
let w:airline_section_gutter = ''
|
let w:airline_section_gutter = '%='
|
||||||
endif
|
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
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -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_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_b', '%{get(w:, "airline_current_branch", "")}')
|
||||||
call s:check_defined('g:airline_section_c', '%f%m')
|
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_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_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}")
|
||||||
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
|
call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user