Shougo / dein.vim

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

The scripts after a comment will disappear in `dein-toml-ftplugin` in Vim9 #513

Closed 4513ECHO closed 7 months ago

4513ECHO commented 7 months ago

Description

The scripts after a comment will disappear in dein-toml-ftplugin in Vim9.

To Reproduce

Steps to reproduce the behavior:

  1. Start vim with vim -Nu vimrc
  2. See dein/.cache/vimrc/.dein/after/ftplugin.vim

Expected behavior

In the end of dein/.cache/vimrc/.dein/after/ftplugin.vim:

function! s:after_ftplugin()
echomsg 'hoge'
echomsg 'fuga'
endfunction

Actual

function! s:after_ftplugin()
echomsg 'hoge'
endfunction

Desktop:

Minimal Config

set rtp^=~/.cache/vim/dein/repos/github.com/Shougo/dein.vim
let s:dir = expand('<sfile>:p:h') .. '/dein'
if dein#min#load_state(s:dir)
  call dein#begin(s:dir)
  call dein#load_toml(expand('<sfile>:p:h') .. '/dein.toml')
  call dein#end()
  call dein#save_state()
endif
syntax enable
filetype plugin indent on
call dein#recache_runtimepath()
[ftplugin]
_ = '''
echomsg 'hoge'
" This is a comment
echomsg 'fuga'
'''

Additonal Context

In Neovim v0.10.0-dev-2080+g92c59c39c, it works as expected.

Shougo commented 7 months ago

I don't reproduce the problem.

set rtp+=~/src/dein.vim

if &compatible
  set nocompatible
endif

let $CACHE = expand('~/.cache')

if !isdirectory(expand($CACHE))
  call mkdir(expand($CACHE), 'p')
endif

let s:dein_dir = expand('$CACHE/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

call dein#begin(s:dein_dir)
call dein#load_toml('~/work/dein_ftplugin.toml')
call dein#end()

syntax enable
filetype plugin indent on
call dein#recache_runtimepath()
Shougo commented 7 months ago

Vim or Neovim version: Vim 9.0.2018

Please use the latest version.

Shougo commented 7 months ago
if dein#min#load_state(s:dir)
  call dein#begin(s:dir)
  call dein#load_toml(expand('<sfile>:p:h') .. '/dein.toml')
  call dein#end()
  call dein#save_state()
endif

I think your state file is not updated when you have updated toml file.

Shougo commented 7 months ago

I don't reproduce it, but in dpp.vim the comment is not removed.

Shougo commented 7 months ago

Fixed.