mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
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>
This commit is contained in:
9
runtime/autoload/dist/ft.vim
vendored
9
runtime/autoload/dist/ft.vim
vendored
@@ -407,10 +407,11 @@ export def FThtml()
|
|||||||
var n = 1
|
var n = 1
|
||||||
|
|
||||||
# Test if the filename follows the Angular component template convention
|
# Test if the filename follows the Angular component template convention
|
||||||
if expand('%:t') =~ '^.*\.component\.html$'
|
# Disabled for the reasons mentioned here: #13594
|
||||||
setf htmlangular
|
# if expand('%:t') =~ '^.*\.component\.html$'
|
||||||
return
|
# setf htmlangular
|
||||||
endif
|
# return
|
||||||
|
# endif
|
||||||
|
|
||||||
while n < 40 && n <= line("$")
|
while n < 40 && n <= line("$")
|
||||||
# Check for Angular
|
# Check for Angular
|
||||||
|
@@ -335,8 +335,8 @@ def s:GetFilenameChecks(): dict<list<string>>
|
|||||||
hoon: ['file.hoon'],
|
hoon: ['file.hoon'],
|
||||||
hostconf: ['/etc/host.conf', 'any/etc/host.conf'],
|
hostconf: ['/etc/host.conf', 'any/etc/host.conf'],
|
||||||
hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'],
|
hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'],
|
||||||
html: ['file.html', 'file.htm', 'file.cshtml'],
|
# file.component.html should be HTML, not Angular, see #13594
|
||||||
htmlangular: ['file.component.html'],
|
html: ['file.html', 'file.htm', 'file.cshtml', 'file.component.html'],
|
||||||
htmlm4: ['file.html.m4'],
|
htmlm4: ['file.html.m4'],
|
||||||
httest: ['file.htt', 'file.htb'],
|
httest: ['file.htt', 'file.htb'],
|
||||||
hurl: ['file.hurl'],
|
hurl: ['file.hurl'],
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
555,
|
||||||
/**/
|
/**/
|
||||||
554,
|
554,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user