mirror of
https://github.com/neovim/neovim.git
synced 2026-05-23 21:30:11 +00:00
vim-patch:9.2.0500: filetype: some html files wrongly recognized as htmlangular (#39880)
Problem: filetype: some html files are wrongly recognized as htmlangular
Solution: Use the \< atom to anchor ng-template and ng-content to start
of word (truffle)
Prevent false-positive htmlangular detection on words containing
'ng-template' or 'ng-content' as a substring (e.g. 'song-template',
'sing-content'). Anchor both branches with \< to require a word start,
matching the \<DTD\s\+XHTML\s idiom used five lines below.
related: neovim/neovim#39778.
closes: vim/vim#20246
354ab1a69e
Co-authored-by: truffle <truffleagent@gmail.com>
This commit is contained in:
@@ -848,7 +848,7 @@ function M.html(_, bufnr)
|
||||
if
|
||||
matchregex(
|
||||
line,
|
||||
[[@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content]]
|
||||
[[@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|\<ng-template\|\<ng-content]]
|
||||
)
|
||||
then
|
||||
return 'htmlangular'
|
||||
|
||||
Reference in New Issue
Block a user