Mercurial > vim
changeset 35624:7f3e4cb73c27 v9.1.0555
patch 9.1.0555: filetype: angular ft detection is still problematic
Commit: https://github.com/vim/vim/commit/c03f631b7b01e672787b222a55898f8dcac8d859
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Jul 10 19:23:39 2024 +0200
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: #15190
related: #13594
related: #13604
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 10 Jul 2024 19:45:06 +0200 |
parents | c037664384d0 |
children | 6400067548b8 |
files | runtime/autoload/dist/ft.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 3 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -407,10 +407,11 @@ export def FThtml() var n = 1 # Test if the filename follows the Angular component template convention - if expand('%:t') =~ '^.*\.component\.html$' - setf htmlangular - return - endif + # Disabled for the reasons mentioned here: #13594 + # if expand('%:t') =~ '^.*\.component\.html$' + # setf htmlangular + # return + # endif while n < 40 && n <= line("$") # Check for Angular
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -335,8 +335,8 @@ def s:GetFilenameChecks(): dict<list<str hoon: ['file.hoon'], hostconf: ['/etc/host.conf', 'any/etc/host.conf'], hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'], - html: ['file.html', 'file.htm', 'file.cshtml'], - htmlangular: ['file.component.html'], + # file.component.html should be HTML, not Angular, see #13594 + html: ['file.html', 'file.htm', 'file.cshtml', 'file.component.html'], htmlm4: ['file.html.m4'], httest: ['file.htt', 'file.htb'], hurl: ['file.hurl'],