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>ci :ColorVInsert<CR>
|
||||||
nnoremap <space>cp :ColorVPicker<CR>
|
nnoremap <space>cp :ColorVPicker<CR>
|
||||||
|
|
||||||
let g:colorv_is_previewing = 0
|
|
||||||
function! ToggleColorPreview() abort
|
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'
|
execute 'ColorVPreview'
|
||||||
let g:colorv_is_previewing = 1
|
let b:colorv_is_previewing = 1
|
||||||
else
|
else
|
||||||
execute 'ColorVClear'
|
execute 'ColorVClear'
|
||||||
let g:colorv_is_previewing = 0
|
let b:colorv_is_previewing = 0
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
|
|
Loading…
Reference in New Issue