fix autoload/lightline.vim: fix indexing for raw type

This commit is contained in:
itchyny
2015-06-23 22:34:23 +09:00
parent 13fb725403
commit 7413b2464b

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2015/03/01 10:51:32.
" Last Change: 2015/06/23 22:33:07.
" =============================================================================
let s:save_cpo = &cpo
@@ -357,7 +357,7 @@ function! s:line(tabline, inactive) abort
let _ .= printf('%%#LightLineLeft_%s_%s#', mode, ll[i])
for j in range(len(lt[i]))
let x = substitute('%( '.(lc[i][j] ? lt[i][j] : has_key(f,lt[i][j])?'%{exists("*'.f[lt[i][j]].'")?'.f[lt[i][j]].'():""}':get(c,lt[i][j],'')).' %)', '^%( %)', '', '')
let _ .= has_key(t,lt[i][j])&&t[lt[i][j]]==#'raw'&&strlen(x)>7 ? x[3:-2] : x
let _ .= has_key(t,lt[i][j])&&t[lt[i][j]]==#'raw'&&strlen(x)>7 ? x[3:-4] : x
if j < len(lt[i]) - 1 | let _ .= s:subseparator(lt[i][j], lt[i][j+1:], s.left, lc[i][j], lc[i][j+1:]) | endif
endfor
let _ .= printf('%%#LightLineLeft_%s_%s_%s#', mode, ll[i], ll[i + 1]) . (i < l + len(lt) - len(l_) && ll[i] < l || type(ll[i]) != type(ll[i + 1]) || type(ll[i]) && type(ll[i + 1]) && ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : '')