## versions
vim version: NVIM v0.5.0-374-gd9657b3ae
node version: v10.20.1
coc.nvim version: 0.0.78-95e7ca8324
coc.nivm directory: /opt/vim.plugged/coc.nvim
term: xterm-256color
platform: linux
## Output channel: prettier
When I run :CocInstall or :CocUpdate, my custom vim option scrolloff is reset to zero.
Create file mini.vim with:
set nocompatible
set runtimepath^=/path/to/coc.nvim
filetype plugin indent on
syntax on
set hidden
Start (neo)vim with command: vim -u mini.vim
run :set scrolloff=10
run :set scrolloff? (output: scrolloff=10)
run :CocUpdate or :CocInstall <any-coc-extension>, like :CocInstall coc-python or :CocInstall coc-rust-analyzer.
run :set scrolloff? again (output: scrolloff=0, expected 10 instead)
The option change only affect install window.
Negative. It also affects the original window. Please reopen and consider reproducing again with this more fleshed example, while navigating coc's README.md
mini.vim
set nocompatible
set runtimepath^=/opt/vim.plugged/coc.nvim
filetype plugin indent on
syntax on
set hidden
$ wget https://raw.githubusercontent.com/neoclide/coc.nvim/master/README.md$ nvim README.md -u mini.vim:150<cr> to navigate somewhere in the middle of the file:set scrolloff=10<cr>zt and zb, see how the cursor stops 10 lines before the top and bottom edges of the window.:CocUpdate<cr>, the update/install window opens.<c-w>o. This takes you back to README.md window.zt and zb in the README.md window, see how the cursor now hit the top and bottom edges of the window.:set scrolloff?<cr> yields 0 instead of 10, not only in the install window.I don't understand the way issues are used in this repo, should I open another issue?
No, can't reproduce, try minimal vimrc
I reproduced.
On my setup scrolloff starts with 1, I set it to 10, after :CocUpdate it becomes 0, which was checked after closing the update window with q.
The only place scrolloff is found is here
It's using setl to set options only locally, but the option is global according to vimhelp.
So, there's no way to set it local, and global value gets set, but is not recovered.
Possibly care should be taken wherever this is being practiced, for any option that's global.
No, can't reproduce, try minimal vimrc
@chemzqm What's more minimal than the mini.vim I have tried?
Folks, hope you're OK with reopening this one as it's easy to reproduce and the code line with the issue has been pointed.
I think it's worth warning again this may be happening for other global-only settings too, here or elsewhere in the codebase.
Not all options have a local value. If the option does not have a local value the global value is set.