mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 00:22:41 +00:00
vim-patch:9.1.0555: filetype: angular ft detection is still problematic
Problem: filetype: angular ft detection is still problematic
(after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
do not try to determine it from a generic name like
'*.component.html'
For the reasons mentioned here:
https://github.com/vim/vim/pull/13594#issuecomment-1834465890
related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604
c03f631b7b
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -710,12 +710,13 @@ function M.haredoc(path, _)
|
||||
end
|
||||
|
||||
--- @type vim.filetype.mapfn
|
||||
function M.html(path, bufnr)
|
||||
-- Test if the filename follows the Angular component template convention
|
||||
local filename = fn.fnamemodify(path, ':t')
|
||||
if filename:find('%.component%.html$') then
|
||||
return 'htmlangular'
|
||||
end
|
||||
function M.html(_, bufnr)
|
||||
-- Disabled for the reasons mentioned here:
|
||||
-- https://github.com/vim/vim/pull/13594#issuecomment-1834465890
|
||||
-- local filename = fn.fnamemodify(path, ':t')
|
||||
-- if filename:find('%.component%.html$') then
|
||||
-- return 'htmlangular'
|
||||
-- end
|
||||
|
||||
for _, line in ipairs(getlines(bufnr, 1, 40)) do
|
||||
if
|
||||
|
||||
Reference in New Issue
Block a user