Skip to content

Commit

Permalink
lightline#link has an optional argument (close morhetz#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Aug 29, 2013
1 parent e64a73f commit 433cff0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions autoload/lightline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions doc/lightline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 433cff0

Please sign in to comment.