aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-05-08 03:28:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-05-08 03:28:39 +1200
commit88c9d443d104e2da4d0ce48609f8430a7d5d02b8 (patch)
tree0dc167350aa7f3ef7e0d2c64bef96152fa285bbd /vim
parentAdd map to start Thunar (diff)
downloaddotfiles-88c9d443d104e2da4d0ce48609f8430a7d5d02b8.tar.gz
dotfiles-88c9d443d104e2da4d0ce48609f8430a7d5d02b8.zip
Support <main> element for HTML Vim lang detection
Diffstat (limited to 'vim')
-rw-r--r--vim/autoload/html/spelllang.vim10
1 files changed, 5 insertions, 5 deletions
diff --git a/vim/autoload/html/spelllang.vim b/vim/autoload/html/spelllang.vim
index c01a57b2..e451f8a1 100644
--- a/vim/autoload/html/spelllang.vim
+++ b/vim/autoload/html/spelllang.vim
@@ -1,13 +1,13 @@
-" Crude regular expression to match an <html> or <body> tag on one line with
-" a lang= attribute set. This isn't exact, by any means, but I don't want to
-" write an actual HTML parser for a mere 'spelllang' hook nicety that fails
-" silently anyway.
+" Crude regular expression to match an <html>, <body>, or <main> tag on one
+" line with a lang= attribute set. This isn't exact, by any means, but
+" I don't want to write an actual HTML parser for a mere 'spelllang' hook
+" nicety that fails silently anyway.
"
" The first submatch is the language code, e.g. "en", "es". The second
" submatch is optional and follows a hyphen and is for the regional code,
" e.g. "US", "GB", "AR".
"
-let s:pattern = '\m\c<\%(html\|body\)\>[^>]*\<lang=["'']\='
+let s:pattern = '\m\c<\%(html\|body\|main\)\>[^>]*\<lang=["'']\='
\ . '\([a-z-]\{2,}\)\%(-\([a-z]\{2,}\)\)'
" The line count limit for looking for the pattern; no sense churning through