fix(ftplugin): respect runtimepath ordering

Problem: bundled `ftplugin/foo/*.vim` are sourced before user
`ftplugin/foo.vim`.

Solution: call `runtime!` once on all patterns to be sourced.

Followup to #23801. Fixes #24003.
This commit is contained in:
Christian Clason 2023-06-25 12:34:30 +02:00
parent 8182384205
commit 502a7a0558

View File

@ -30,9 +30,10 @@ augroup filetypeplugin
for name in split(s, '\.')
" Load Lua ftplugins after Vim ftplugins _per directory_
" TODO(clason): use nvim__get_runtime when supports globs and modeline
exe printf('runtime! ftplugin/%s.vim ftplugin/%s.lua', name, name)
exe printf('runtime! ftplugin/%s_*.vim ftplugin/%s_*.lua', name, name)
exe printf('runtime! ftplugin/%s/*.vim ftplugin/%s/*.lua', name, name)
exe printf('runtime! ftplugin/%s.vim ftplugin/%s.lua
\ ftplugin/%s_*.vim ftplugin/%s_*.lua
\ ftplugin/%s/*.vim ftplugin/%s/*.lua',
\ name, name, name, name, name, name)
endfor
endif
endfunc