lightline#link has an optional argument (close #17)

This commit is contained in:
itchyny
2013-08-30 01:23:09 +09:00
parent e64a73f308
commit 433cff0c4d
2 changed files with 7 additions and 7 deletions

View File

@@ -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)

View File

@@ -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