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, '\.') for name in split(s, '\.')
" Load Lua ftplugins after Vim ftplugins _per directory_ " Load Lua ftplugins after Vim ftplugins _per directory_
" TODO(clason): use nvim__get_runtime when supports globs and modeline " 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
exe printf('runtime! ftplugin/%s_*.vim ftplugin/%s_*.lua', name, name) \ ftplugin/%s_*.vim ftplugin/%s_*.lua
exe printf('runtime! ftplugin/%s/*.vim ftplugin/%s/*.lua', name, name) \ ftplugin/%s/*.vim ftplugin/%s/*.lua',
\ name, name, name, name, name, name)
endfor endfor
endif endif
endfunc endfunc