ToggleColorPreview - use buffer local variables not global
This commit is contained in:
parent
185d046855
commit
5d862fb200
|
@ -314,14 +314,16 @@ nnoremap <space>cc :call ToggleColorPreview()<CR>
|
|||
nnoremap <space>ci :ColorVInsert<CR>
|
||||
nnoremap <space>cp :ColorVPicker<CR>
|
||||
|
||||
let g:colorv_is_previewing = 0
|
||||
function! ToggleColorPreview() abort
|
||||
if g:colorv_is_previewing == 0
|
||||
if !exists('b:colorv_is_previewing')
|
||||
let b:colorv_is_previewing = 0
|
||||
endif
|
||||
if b:colorv_is_previewing == 0
|
||||
execute 'ColorVPreview'
|
||||
let g:colorv_is_previewing = 1
|
||||
let b:colorv_is_previewing = 1
|
||||
else
|
||||
execute 'ColorVClear'
|
||||
let g:colorv_is_previewing = 0
|
||||
let b:colorv_is_previewing = 0
|
||||
endif
|
||||
endfunction
|
||||
"}}}
|
||||
|
|
Loading…
Reference in New Issue