patch 9.1.0555: filetype: angular ft detection is still problematic Commit: https://github.com/vim/vim/commit/c03f631b7b01e672787b222a55898f8dcac8d859 Author: Christian Brabandt <c...@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 <c...@256bit.org> diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 1a4195a9d..3c7d85cec 100644 --- 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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index de8788660..3b0b2e99a 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -335,8 +335,8 @@ def s:GetFilenameChecks(): dict<list<string>> 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'], diff --git a/src/version.c b/src/version.c index 0de9c555d..96691df61 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 555, /**/ 554, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1sRbNL-00FY6l-0V%40256bit.org.