Closed juanMarinero closed 2 years ago
See pull request 79 where at start of function! peekaboo#aboo()
of vim-peekaboo/autoload/peekaboo.vim
I added
let g:foldcolumn_orig=&foldcolumn " at EO-func restore original
set foldcolumn=0 " so peekaboo vsplit has it too
and at end I appended
" restore with window foldcolumn
exec 'set foldcolumn='.g:foldcolumn_orig
But I think I would be clearer with a decorator, like:
nnoremap <leader>z <C-u>:call Peekaboo_aboo_Wrapper()<CR>
function! Peekaboo_aboo_Wrapper(...)
" python wrapper decorator for Vim
" ... read https://vim.fandom.com/wiki/Write_your_own_Vim_function
" before call peekaboo#aboo
let g:foldcolumn_orig=&foldcolumn
set foldcolumn=0 " so peekaboo vsplit has it too
" wrapped function
let params = [] " not empty, minimun required: list
:call call (function('peekaboo#aboo'), params)
" after call peekaboo#aboo
" wincmd p " move-cursor-back-to-previous-window-after-splitting
exec 'set foldcolumn='.g:foldcolumn_orig
endfunction
behavior
When opening a vertical split (
:vsplit
) thefoldcolumn
setting from original window is set in the vertical split one.Same happens with vim-peekaboo.
See next screenshots, in its command line I executed
:set foldcolumn?
just before pressing"
in normal mode:desired behavior
Either:
:set foldcolumn=0
Suggestions
:set foldcolumn=0
in vim plugin just after create the vertical splitnnoremap <silent> <F1> :<c-u>let foldcolumn_orig=&foldcolumn <bar> set foldcolumn=0 <bar> call peekaboo#aboo() <bar> exec 'set foldcolumn='.foldcolumn_orig <cr>
Desktop
Ubuntu 20.04 Vim 8.2
Thanks in advance!