mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(ftplugin): source Lua files after Vimscript files per directory (#23801)
Problem: Lua ftplugins in runtime take precedence over Vimscript ftplugins in user configs (even in `after/`). Solution: Source ftplugins separately per directory, first Vimscript then Lua.
This commit is contained in:
parent
8e17054a23
commit
03a2c5b772
@ -28,9 +28,11 @@ augroup filetypeplugin
|
|||||||
" When there is a dot it is used to separate filetype names. Thus for
|
" When there is a dot it is used to separate filetype names. Thus for
|
||||||
" "aaa.bbb" load "aaa" and then "bbb".
|
" "aaa.bbb" load "aaa" and then "bbb".
|
||||||
for name in split(s, '\.')
|
for name in split(s, '\.')
|
||||||
exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
|
" Load Lua ftplugins after Vim ftplugins _per directory_
|
||||||
" Load lua ftplugins
|
" TODO(clason): use nvim__get_runtime when supports globs and modeline
|
||||||
exe printf('runtime! ftplugin/%s.lua ftplugin/%s_*.lua ftplugin/%s/*.lua', name, 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', name, name)
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
Loading…
Reference in New Issue
Block a user