-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add markdown comment syntax highlighting #157
Comments
Do you recall any examples where the builtin I've noticed there's a diff --git a/syntax/lean.vim b/syntax/lean.vim
index 3c87fde..7ebae61 100644
--- a/syntax/lean.vim
+++ b/syntax/lean.vim
@@ -75,9 +75,10 @@ syn match leanNumber '\<\d\d*\.\d*\>'
syn match leanNameLiteral '``*[^ \[()\]}][^ ()\[\]{}]*'
-" syn include @markdown syntax/markdown.vim
+let main_syntax = 'lean'
+syn include @markdown syntax/markdown.vim
syn region leanBlockComment start="/-" end="-/" contains=@markdown,@Spell,leanBlockComment
-syn match leanComment "--.*" contains=@Spell
+syn match leanComment "--.*" contains=@markdown,@Spell
" fix up some highlighting links for markdown
hi! link markdownCodeBlock Comment
hi! link markdownError Comment
diff --git a/syntax/lean3.vim b/syntax/lean3.vim
index cbcce85..fe2f081 100644
--- a/syntax/lean3.vim
+++ b/syntax/lean3.vim
@@ -69,9 +69,10 @@ syn match leanNumber '\<\d\d*\.\d*\>'
syn match leanNameLiteral '``*[^ \[()\]}][^ ()\[\]{}]*'
-" syn include @markdown syntax/markdown.vim
+let main_syntax = 'lean'
+syn include @markdown syntax/markdown.vim
syn region leanBlockComment start="/-" end="-/" contains=@markdown,@Spell,leanBlockComment
-syn match leanComment "--.*" contains=@Spell
+syn match leanComment "--.*" contains=@markdown,@Spell
" fix up some highlighting links for markdown
hi! link markdownCodeBlock Comment
hi! link markdownError Comment looks OK at first glance. Let me know if you recall anything specific I can look at to see if it's still syntax-broken. |
Two examples where the markdown highlighting continues after comment ends:
Looking through lean files in core and mathlib (and the Lean 4 versions) is a good idea. |
Another common instance of the issue is commented-out code:
|
Yeah thanks, those were helpful (in the sense they showed that setting |
The important ones are
# headlines
,*emphasis*
, and`inline code`
.The text was updated successfully, but these errors were encountered: