Syntax highlighting fixes

This commit is contained in:
Max Bucknell 2025-01-19 11:38:09 +00:00
parent 86856bf960
commit dfca541147
No known key found for this signature in database
4 changed files with 6 additions and 9 deletions

View file

@ -2,7 +2,7 @@ function! asyncomplete#sources#mbnotes#get_source_options(opts)
let l:defaults = { let l:defaults = {
\ 'name': 'mbnotes', \ 'name': 'mbnotes',
\ 'completor': function('asyncomplete#sources#mbnotes#completor'), \ 'completor': function('asyncomplete#sources#mbnotes#completor'),
\ 'allowlist': ['mbnotes.quarto'] \ 'allowlist': ['mbnotes']
\ } \ }
return extend(l:defaults, a:opts) return extend(l:defaults, a:opts)

View file

@ -72,7 +72,7 @@ export def BeforeNoteSave()
var daily_path = g:mbnotes_dir .. "/daily" var daily_path = g:mbnotes_dir .. "/daily"
# Only rename bona fide notes # Only rename bona fide notes
if directory != expand(g:mbnotes_dir) if directory == expand(g:mbnotes_dir)
var base = expand('%:t') var base = expand('%:t')
var date = base[0 : 9] var date = base[0 : 9]

View file

@ -4,7 +4,7 @@ def IsMBNotes()
var path_prefix = expand('%:p')[0 : len(g:mbnotes_dir) - 1] var path_prefix = expand('%:p')[0 : len(g:mbnotes_dir) - 1]
if path_prefix == g:mbnotes_dir if path_prefix == g:mbnotes_dir
set filetype=mbnotes.quarto set filetype=mbnotes
endif endif
enddef enddef

View file

@ -1,6 +1,5 @@
vim9s
if exists("b:current_syntax") if exists("b:current_syntax")
echom b:current_syntax
finish finish
endif endif
@ -17,9 +16,7 @@ syn region mbnCalloutImportant start=":::\s\+{\.callout-important\s*" end=":::$"
hi link mbnCalloutImportant SpellBad hi link mbnCalloutImportant SpellBad
syn region mbnCalloutTip start=":::\s\+{\.callout-tip\s*" end=":::$" keepend syn region mbnCalloutTip start=":::\s\+{\.callout-tip\s*" end=":::$" keepend
hi link mbnCalloutNote Question hi link mbnCalloutTip Question
syn region mbnCalloutCaution start=":::\s\+{\.callout-caution\s*" end=":::$" keepend syn region mbnCalloutCaution start=":::\s\+{\.callout-caution\s*" end=":::$" keepend
hi link mbnCalloutWarning SpellCap hi link mbnCalloutCaution SpellCap
b:current_syntax = "mbnotes"