Closed 4513ECHO closed 1 month ago
plugin-local ftplugins are overwritten by global ftplugins.
Merged correctly.
dpp.vim version (SHA1): 3c914cad6447994c1b8e03a1474402a14a63fc63
3c914cad6447994c1b8e03a1474402a14a63fc63
denops.vim version (SHA1): e5824b023357087d73fbd1164c024a0136a02a54
e5824b023357087d73fbd1164c024a0136a02a54
deno version(deno -V output): deno 1.45.5
deno -V
deno 1.45.5
OS: macOS Sonoma 14.5
neovim/Vim :version output:
:version
set runtimepath^=/path/to/github.com/vim-denops/denops.vim set runtimepath^=/path/to/github.com/Shougo/dpp.vim const s:dpp_dir = fnamemodify('./cache', ':p') const s:dpp_ts = fnamemodify('./dpp.ts', ':p') if dpp#min#load_state(s:dpp_dir) autocmd User DenopsReady call dpp#make_state(s:dpp_dir, s:dpp_ts) autocmd User Dpp:makeStatePost quit endif
import { BaseConfig, type ConfigArguments, type ConfigReturn, } from "jsr:@shougo/dpp-vim@^1.1.0/config"; import type { MultipleHook, Plugin } from "jsr:@shougo/dpp-vim@^1.1.0/types"; import { mergeFtplugins } from "jsr:@shougo/dpp-vim@^1.1.0/utils"; type Toml = { ftplugins?: Record<string, string>; hooks_file?: string; multiple_hooks?: MultipleHook[]; plugins?: Plugin[]; }; function mergeToml(tomls: Toml[]): ConfigReturn { return { ftplugins: tomls.map((x) => x.ftplugins).reduce((acc, x) => { if (!x) return acc; if (!acc) return x; mergeFtplugins(acc, x); return acc; }), hooksFiles: tomls.map((x) => x.hooks_file) .filter((x) => typeof x === "string"), multipleHooks: tomls.flatMap((x) => x.multiple_hooks ?? []), plugins: tomls.flatMap((x) => x.plugins ?? []), }; } export class Config extends BaseConfig { override config(_args: ConfigArguments): ConfigReturn { const { plugins, ftplugins } = mergeToml([ { plugins: [{ name: "hoge", ftplugin: { help: "echo 'plugins 1'" } }] }, { ftplugins: { help: "echo 'ftplugins'" } }, { plugins: [{ name: "fuga", ftplugin: { help: "echo 'plugins 2'" } }] }, ]); return { ftplugins, plugins, }; } }
nvim -nNu init.vim -i NONE --headless
vim -nNu init.vim -i NONE
cache/{nvim,vim}/.dpp/after/ftplugin/help.vim
if 'b:undo_ftplugin'->exists() let b:undo_ftplugin ..= '|' else let b:undo_ftplugin = '' endif echo 'ftplugins'
None.
:redir
:message
OK. I get it.
Plugins ftplugins are merged when it is installed.
I have added the description. It is feature.
Problems summary
plugin-local ftplugins are overwritten by global ftplugins.
Expected
Merged correctly.
Environment Information
dpp.vim version (SHA1):
3c914cad6447994c1b8e03a1474402a14a63fc63
denops.vim version (SHA1):
e5824b023357087d73fbd1164c024a0136a02a54
deno version(
deno -V
output):deno 1.45.5
OS: macOS Sonoma 14.5
neovim/Vim
:version
output:Neovim
``` NVIM v0.11.0-dev-3725+g0c2860d9e-Homebrew Build type: Release LuaJIT 2.1.1720049189 Run ":verbose version" for more info ```Vim
``` VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 04 2024 17:57:44) macOS 版 - arm64 適用済パッチ: 1-660 Compiled by Homebrew Huge 版 without GUI. 機能の一覧 有効(+)/無効(-) +acl +file_in_path +mouse_urxvt -tag_any_white +arabic +find_in_path +mouse_xterm -tcl +autocmd +float +multi_byte +termguicolors +autochdir +folding +multi_lang +terminal -autoservername -footer -mzscheme +terminfo -balloon_eval +fork() +netbeans_intg +termresponse +balloon_eval_term +gettext +num64 +textobjects -browse -hangul_input +packages +textprop ++builtin_terms +iconv +path_extra +timers +byte_offset +insert_expand +perl +title +channel +ipv6 +persistent_undo -toolbar +cindent +job +popupwin +user_commands -clientserver +jumplist +postscript +vartabs +clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +vim9script +cmdline_hist +langmap -python +viminfo +cmdline_info +libcall +python3 +virtualedit +comments +linebreak +quickfix +visual +conceal +lispindent +reltime +visualextra +cryptv +listcmds +rightleft +vreplace +cscope +localmap +ruby +wildignore +cursorbind +lua +scrollbind +wildmenu +cursorshape +menu +signs +windows +dialog_con +mksession +smartindent +writebackup +diff +modify_fname +sodium -X11 +digraphs +mouse +sound -xattr -dnd -mouseshape +spell -xfontset -ebcdic +mouse_dec +startuptime -xim +emacs_tags -mouse_gpm +statusline -xpm +eval -mouse_jsbterm -sun_workshop -xsmp +ex_extra +mouse_netterm +syntax -xterm_clipboard +extra_search +mouse_sgr +tag_binary -xterm_save -farsi -mouse_sysmouse -tag_old_static システム vimrc: "$VIM/vimrc" ユーザー vimrc: "$HOME/.vimrc" 第2ユーザー vimrc: "~/.vim/vimrc" 第3ユーザー vimrc: "$XDG_CONFIG_HOME/vim/vimrc" ユーザー exrc: "$HOME/.exrc" デフォルトファイル: "$VIMRUNTIME/defaults.vim" 省略時の $VIM: "/Users/234531sch/Library/homebrew/share/vim" コンパイル: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -I/Users/234531sch/Library/homebrew/Cellar/libsodium/1.0.20/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 リンク: clang -o vim -lm -lncurses -L/Users/234531sch/Library/homebrew/Cellar/libsodium/1.0.20/lib -lsodium -liconv -lintl -framework AppKit -L/Users/234531sch/Library/homebrew/opt/lua/lib -llua5.4 -mmacosx-version-min=14.4 -fstack-protector-strong -L/Users/234531sch/Library/homebrew/opt/perl/lib/perl5/5.38/darwin-thread-multi-2level/CORE -lperl -L/Users/234531sch/Library/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib/python3.12/config-3.12-darwin -lpython3.12 -lintl -framework CoreFoundation -lruby.3.3 -L/Users/234531sch/Library/homebrew/Cellar/ruby/3.3.4/lib ```Provide a minimal init.vim/vimrc without plugin managers (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)
nvim -nNu init.vim -i NONE --headless
orvim -nNu init.vim -i NONE
cache/{nvim,vim}/.dpp/after/ftplugin/help.vim
Screenshot (if possible)
None.
Upload the log messages by
:redir
and:message
(if errored)None.