diff --git a/autoload/lightline.vim b/autoload/lightline.vim index 5889a31..2b2ad6d 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -3,7 +3,7 @@ " Version: 0.0 " Author: itchyny " License: MIT License -" Last Change: 2013/08/28 10:07:44. +" Last Change: 2013/08/30 01:07:12. " ============================================================================= let s:save_cpo = &cpo @@ -81,8 +81,8 @@ function! lightline#mode() return get(s:lightline.mode_map, mode(), s:lightline.mode_map['?']) endfunction -function! lightline#link() - let mode = get(s:lightline._mode_, mode(), 'normal') +function! lightline#link(...) + let mode = get(s:lightline._mode_, a:0 ? a:1 : mode(), 'normal') for i in range(len(s:lightline.active.left)) exec printf('hi link LightLineLeft_active_%d LightLineLeft_%s_%d', i, mode, i) exec printf('hi link LightLineLeft_active_%d_%d LightLineLeft_%s_%d_%d', i, i + 1, mode, i, i + 1) diff --git a/doc/lightline.txt b/doc/lightline.txt index 48556bc..a1b2a48 100644 --- a/doc/lightline.txt +++ b/doc/lightline.txt @@ -4,7 +4,7 @@ Version: 0.0 Author: itchyny (https://github.com/itchyny) License: MIT License Repository: https://github.com/itchyny/lightline.vim -Last Change: 2013/08/29 14:44:34. +Last Change: 2013/08/30 01:14:19. CONTENTS *lightline-contents* @@ -250,10 +250,10 @@ Exposed functions for lightline.vim. lightline#update_once() *lightline#update_once()* Updates the statuslines only once. -Following functions are exposed, but users may not need. - - lightline#link() *lightline#link()* + lightline#link(...) *lightline#link()* Creates links of the highlight groups for the active window. + This function accepts an optional argument. It should be one + of the return value of |mode()|. lightline#highlight(inactive) *lightline#highlight()* Returns |statusline| strings. If the argument is 0, it returns