mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
feat(runtime): Allow lua to be used in indent
This commit is contained in:
@@ -25,6 +25,7 @@ augroup filetypeindent
|
|||||||
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
|
" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
|
||||||
for name in split(s, '\.')
|
for name in split(s, '\.')
|
||||||
exe 'runtime! indent/' . name . '.vim'
|
exe 'runtime! indent/' . name . '.vim'
|
||||||
|
exe 'runtime! indent/' . name . '.lua'
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -136,5 +136,24 @@ describe('runtime:', function()
|
|||||||
rmdir(ftplugin_folder)
|
rmdir(ftplugin_folder)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe('indent', function()
|
||||||
|
local indent_folder = table.concat({xconfig, 'nvim', 'indent'}, pathsep)
|
||||||
|
|
||||||
|
before_each(clear)
|
||||||
|
|
||||||
|
it('loads lua indents', function()
|
||||||
|
local indent_file = table.concat({indent_folder , 'new-ft.lua'}, pathsep)
|
||||||
|
mkdir_p(indent_folder)
|
||||||
|
write_file(indent_file , [[ vim.g.lua_indent = 1 ]])
|
||||||
|
|
||||||
|
clear{ args_rm={'-u' }, env={ XDG_CONFIG_HOME=xconfig, VIMRUNTIME='runtime/' }}
|
||||||
|
|
||||||
|
exec [[set filetype=new-ft]]
|
||||||
|
eq(1, eval('g:lua_indent'))
|
||||||
|
rmdir(indent_folder)
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user