update the spell component, hide the component when 'spell' is off (fix #162, ref #70)

This commit is contained in:
itchyny
2016-05-08 13:54:02 +09:00
parent 0c7f4f907e
commit a9c74efa36
2 changed files with 7 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim " Filename: autoload/lightline.vim
" Author: itchyny " Author: itchyny
" License: MIT License " License: MIT License
" Last Change: 2016/05/07 22:18:16. " Last Change: 2016/05/08 13:50:23.
" ============================================================================= " =============================================================================
let s:save_cpo = &cpo let s:save_cpo = &cpo
@@ -102,14 +102,13 @@ let s:_lightline = {
\ 'component': { \ 'component': {
\ 'mode': '%{lightline#mode()}', \ 'mode': '%{lightline#mode()}',
\ 'absolutepath': '%F', 'relativepath': '%f', 'filename': '%t', 'modified': '%M', 'bufnum': '%n', \ 'absolutepath': '%F', 'relativepath': '%f', 'filename': '%t', 'modified': '%M', 'bufnum': '%n',
\ 'spell': '%{&spell?&spelllang:"no spell"}',
\ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B', \ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B',
\ 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}', \ 'spell': '%{&spell?&spelllang:""}', 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}',
\ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P', \ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P',
\ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X ' \ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X '
\ }, \ },
\ 'component_visible_condition': { \ 'component_visible_condition': {
\ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste' \ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
\ }, \ },
\ 'component_function': {}, \ 'component_function': {},
\ 'component_expand': { \ 'component_expand': {

View File

@@ -4,7 +4,7 @@ Version: 0.0
Author: itchyny (https://github.com/itchyny) Author: itchyny (https://github.com/itchyny)
License: MIT License License: MIT License
Repository: https://github.com/itchyny/lightline.vim Repository: https://github.com/itchyny/lightline.vim
Last Change: 2016/04/23 13:49:14. Last Change: 2016/05/08 13:56:19.
CONTENTS *lightline-contents* CONTENTS *lightline-contents*
@@ -109,7 +109,7 @@ OPTIONS *lightline-option*
\ 'filetype': '%{&ft!=#""?&ft:"no ft"}', \ 'filetype': '%{&ft!=#""?&ft:"no ft"}',
\ 'percent': '%3p%%', \ 'percent': '%3p%%',
\ 'percentwin': '%P', \ 'percentwin': '%P',
\ 'spell': '%{&spell?&spelllang:"no spell"}', \ 'spell': '%{&spell?&spelllang:""}',
\ 'lineinfo': '%3l:%-2v', \ 'lineinfo': '%3l:%-2v',
\ 'line': '%l', \ 'line': '%l',
\ 'column': '%c' \ 'column': '%c'
@@ -124,7 +124,8 @@ OPTIONS *lightline-option*
let g:lightline.component_visible_condition = { let g:lightline.component_visible_condition = {
\ 'modified': '&modified||!&modifiable', \ 'modified': '&modified||!&modifiable',
\ 'readonly': '&readonly', \ 'readonly': '&readonly',
\ 'paste': '&paste' } \ 'paste': '&paste',
\ 'spell': '&spell' }
< <
Users are recommended to set this option together with the Users are recommended to set this option together with the
component itself. component itself.