Add :BrightestLock, :BrightestUnlock.

This commit is contained in:
manga_osyo
2014-08-29 14:31:31 +09:00
parent 905e35eeea
commit 572d8bdb13
3 changed files with 15 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ endfunction
function! s:is_enable_in_current(context) function! s:is_enable_in_current(context)
let default = get(g:brightest#enable_filetypes, "_", 1) let default = get(g:brightest#enable_filetypes, "_", 1)
return g:brightest_enable && get(g:brightest#enable_filetypes, a:context.filetype, default) return get(g:brightest#enable_filetypes, a:context.filetype, default)
endfunction endfunction

View File

@@ -27,6 +27,12 @@
:BrightestClear *:BrightestClear* :BrightestClear *:BrightestClear*
ハイライトを削除します。 ハイライトを削除します。
:BrightestLock *:BrightestLock*
現在でのバッファで brightest を無効にします。
:BrightestUnlock *:BrightestUnlock*
|:BrightestLock| で無効にしたのを戻します。
============================================================================== ==============================================================================
設定 *brightest-setting* 設定 *brightest-setting*

View File

@@ -24,12 +24,19 @@ command! -bar BrightestHighlight call brightest#highlighting()
command! -bar BrightestClear call brightest#hl_clear() command! -bar BrightestClear call brightest#hl_clear()
command! -bar BrightestEnable let g:brightest_enable = 1 | BrightestHighlight command! -bar BrightestEnable let g:brightest_enable = 1 | BrightestHighlight
command! -bar BrightestDisable let g:brightest_enable = 0 | BrightestClear command! -bar BrightestDisable let g:brightest_enable = 0 | BrightestClear
command! -bar BrightestUnlock let b:brightest_enable = 1 | BrightestHighlight
command! -bar BrightestLock let b:brightest_enable = 0 | BrightestClear
function! s:highlight()
if g:brightest_enable && get(b:, "brightest_enable", 1)
call brightest#highlighting()
endif
endfunction
augroup brightest augroup brightest
autocmd! autocmd!
autocmd CursorMoved * call brightest#highlighting() autocmd CursorMoved * call s:highlight()
autocmd BufLeave,WinLeave,InsertEnter * call brightest#hl_clear() autocmd BufLeave,WinLeave,InsertEnter * call brightest#hl_clear()
autocmd ColorScheme * call s:init_hl() autocmd ColorScheme * call s:init_hl()
augroup END augroup END