]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0555: filetype: angular ft detection is still problematic v9.1.0555
authorChristian Brabandt <cb@256bit.org>
Wed, 10 Jul 2024 17:23:39 +0000 (19:23 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 10 Jul 2024 17:31:00 +0000 (19:31 +0200)
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>
runtime/autoload/dist/ft.vim
src/testdir/test_filetype.vim
src/version.c

index 1a4195a9de2f527c5a6a40405d3624f17c268dd4..3c7d85cec652f05ec60516e2f9c67ada2d5d2a52 100644 (file)
@@ -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
index de8788660e453155fb43ddea62ecad052658e63c..3b0b2e99a5ff48151d5cd6faa49aef24d1eb586f 100644 (file)
@@ -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'],
index 0de9c555dd4a41eb7f713d88d9073f304c85ff82..96691df617ee709fbee276a56e7361c4863cf411 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    555,
 /**/
     554,
 /**/