You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
diff --git a/autoload/minpac/job.vim b/autoload/minpac/job.vim
index 219fabc..f6d7a86 100644
--- a/autoload/minpac/job.vim+++ b/autoload/minpac/job.vim@@ -24,9 +24,6 @@
" SOFTWARE.
" }}}
-let s:save_cpo = &cpo-set cpo&vim-
let s:jobidseq = 0
let s:jobs = {} " { job, opts, type: 'vimjob|nvimjob'}
let s:job_type_nvimjob = 'nvimjob'
If, for some reason, 'cpo' really need to be temporarily reset to its default value, then it should be restored at the end:
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:The text was updated successfully, but these errors were encountered: