Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.42k stars 197 forks source link

An error occurs if there is a newline in the dictionary of the Vim9 script loaded in the hooks_file. #507

Open hokorobi opened 1 year ago

hokorobi commented 1 year ago

Description

An error occurs if there is a newline in the dictionary of the Vim9 script loaded in the hooks_file. Code of Cause in Minimal Config:

g:quickrun_config._ = {
  'runner': 'job',
  'outputter': 'buffer',
  'outputter/buffer/close_on_empty': 1,
}

To Reproduce

Steps to reproduce the behavior:

  1. gvim.exe -N -u ~/vimfiles/vimrc-min-dein-hooks_file-vim9 -U NONE -i NONE See Minimal Config
  2. :call dein#recache_runtimepath()
  3. :quit
  4. gvim.exe -N -u ~/vimfiles/vimrc-min-dein-hooks_file-vim9 -U NONE -i NONE
  5. :set ft=vim
  6. input echo 'vim'
  7. :QuickRun
  8. Error occured See Screenshots. Errors encountered are displayed by :messages.

Expected behavior

No error.

Screenshots

If applicable, add screenshots to help explain your problem.

image

Desktop:

Please complete the following information, when reporting bugs related to the Dein.vim.

Minimal Config

~/vimfiles/vimrc-min-dein-hooks_file-vim9

set nocompatible
set runtimepath+=C:\Users\hokorobi\_vim\dein\repos\github.com\Shougo\dein.vim
let g:testdic = {}
if dein#min#load_state(expand('~/_vim/dein'))
  call dein#begin('~/_vim/dein')
  call dein#add('thinca/vim-quickrun', #{
        \ on_cmd: 'QuickRun',
        \ hooks_file: '~/vimfiles/vimrc-min-dein-hooks_file-vim9_quickrun.vim',
        \ })
  call dein#end()
  call dein#save_state()
endif
filetype plugin indent on
syntax enable

~/vimfiles/vimrc-min-dein-hooks_file-vim9_quickrun.vim

" hook_source {{{
vim9script
g:quickrun_config = get(g:, 'quickrun_config', {})
g:quickrun_config._ = {
  'runner': 'job',
  'outputter': 'buffer',
  'outputter/buffer/close_on_empty': 1,
}
" }}}
Shougo commented 1 year ago

OH no.

Shougo commented 1 year ago

https://github.com/vim/vim/pull/12269 is needed.

Shougo commented 1 year ago

https://github.com/vim/vim/pull/12269 works. Please test.

hokorobi commented 1 year ago

Thank you! I will try to use it when PR is merged.