Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hokorobi opened this issue May 1, 2023 · 4 comments
Labels

Comments

@hokorobi
Copy link
Contributor

hokorobi commented May 1, 2023

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.

  • OS: Windows11
  • Vim or Neovim version: Vim 9.0.1491
  • Commit/Version: 6f40e08

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
Copy link
Owner

Shougo commented May 1, 2023

OH no.

@Shougo Shougo added the Vim8 label May 1, 2023
@Shougo
Copy link
Owner

Shougo commented May 1, 2023

vim/vim#12269 is needed.

@Shougo
Copy link
Owner

Shougo commented May 1, 2023

vim/vim#12269 works. Please test.

@hokorobi
Copy link
Contributor Author

hokorobi commented May 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants