From f126ec2dce581fd25a0b573a8a6ede96d9fa8d68 Mon Sep 17 00:00:00 2001 From: itchyny Date: Sat, 19 Mar 2016 22:36:37 +0900 Subject: [PATCH] tweak lightline#onetab --- autoload/lightline.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index 0f7ef78..817d939 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline.vim " Author: itchyny " License: MIT License -" Last Change: 2016/03/19 22:13:34. +" Last Change: 2016/03/19 22:36:06. " ============================================================================= let s:save_cpo = &cpo @@ -472,11 +472,11 @@ function! lightline#onetab(n, active) abort let tab = s:lightline.tab[a:active ? 'active' : 'inactive'] let tab_component = s:lightline.tab_component let tab_component_function = s:lightline.tab_component_function - for i in range(len(tab)) - if has_key(tab_component_function, tab[i]) - let s = eval(tab_component_function[tab[i]].'('.a:n.')') + for name in tab + if has_key(tab_component_function, name) + let s = eval(tab_component_function[name].'('.a:n.')') else - let s = get(tab_component, tab[i], '') + let s = get(tab_component, name, '') endif if strlen(s) let _ .= (len(_) ? ' ' : '') . s