vim -Nu NONE -S <(cat <<'EOF'
vim9script
set pp=/tmp/.vim rtp=/tmp/.vim
delete('/tmp/.vim', 'rf')
system('git clone https://github.com/k-takata/minpac.git /tmp/.vim/pack/minpac/opt/minpac')
packadd minpac
minpac#init()
minpac#add('k-takata/minpac', {type: 'opt'})
set cpo=BceFsMny>
var cpo = &cpo
minpac#update()
timer_start(1'000, (_) => {
echom 'cpo BEFORE #update(): ' .. cpo
echom 'cpo AFTER #update(): ' .. &cpo
})
EOF
)
Wait for minpac#update() to finish, then run :mess to read the messages.
This is printed:
cpo BEFORE #update(): BceFsMny>
cpo AFTER #update(): aABceFs
Expected behavior
This is printed:
cpo BEFORE #update(): BceFsMny>
cpo AFTER #update(): BceFsMny>
Because minpac should not alter the value of 'cpo' as set by the user.
Environment
Vim version: 8.2 Included patches: 1-2772
OS: Ubuntu 16.04.7 LTS
Terminal: xterm(367)
Additional context
I think the issue comes from autoload/minpac/job.vim which resets 'cpo' to its default Vim value, without restoring it at the end. Considering that no other other script in minpac resets 'cpo', I guess those 2 lines should be removed:
Describe the bug
minpac#update()
alters'cpo'
.To Reproduce
Run this shell command:
Wait for
minpac#update()
to finish, then run:mess
to read the messages.This is printed:
Expected behavior
This is printed:
Because minpac should not alter the value of
'cpo'
as set by the user.Environment
Additional context
I think the issue comes from
autoload/minpac/job.vim
which resets'cpo'
to its default Vim value, without restoring it at the end. Considering that no other other script in minpac resets'cpo'
, I guess those 2 lines should be removed:If, for some reason,
'cpo'
really need to be temporarily reset to its default value, then it should be restored at the end: