From dfca54114793eafb95081964cd5946c4ae2d78c6 Mon Sep 17 00:00:00 2001 From: Max Bucknell Date: Sun, 19 Jan 2025 11:38:09 +0000 Subject: [PATCH] Syntax highlighting fixes --- autoload/asyncomplete/sources/mbnotes.vim | 2 +- autoload/mbnotes.vim | 2 +- ftdetect/mbnotes.vim | 2 +- syntax/mbnotes.vim | 9 +++------ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/autoload/asyncomplete/sources/mbnotes.vim b/autoload/asyncomplete/sources/mbnotes.vim index dc1c468..591a5e2 100644 --- a/autoload/asyncomplete/sources/mbnotes.vim +++ b/autoload/asyncomplete/sources/mbnotes.vim @@ -2,7 +2,7 @@ function! asyncomplete#sources#mbnotes#get_source_options(opts) let l:defaults = { \ 'name': 'mbnotes', \ 'completor': function('asyncomplete#sources#mbnotes#completor'), - \ 'allowlist': ['mbnotes.quarto'] + \ 'allowlist': ['mbnotes'] \ } return extend(l:defaults, a:opts) diff --git a/autoload/mbnotes.vim b/autoload/mbnotes.vim index b5c4b33..6b999bc 100644 --- a/autoload/mbnotes.vim +++ b/autoload/mbnotes.vim @@ -72,7 +72,7 @@ export def BeforeNoteSave() var daily_path = g:mbnotes_dir .. "/daily" # Only rename bona fide notes - if directory != expand(g:mbnotes_dir) + if directory == expand(g:mbnotes_dir) var base = expand('%:t') var date = base[0 : 9] diff --git a/ftdetect/mbnotes.vim b/ftdetect/mbnotes.vim index 3437632..3aa960d 100644 --- a/ftdetect/mbnotes.vim +++ b/ftdetect/mbnotes.vim @@ -4,7 +4,7 @@ def IsMBNotes() var path_prefix = expand('%:p')[0 : len(g:mbnotes_dir) - 1] if path_prefix == g:mbnotes_dir - set filetype=mbnotes.quarto + set filetype=mbnotes endif enddef diff --git a/syntax/mbnotes.vim b/syntax/mbnotes.vim index 15a82d4..7e6acd9 100644 --- a/syntax/mbnotes.vim +++ b/syntax/mbnotes.vim @@ -1,6 +1,5 @@ -vim9s - if exists("b:current_syntax") + echom b:current_syntax finish endif @@ -17,9 +16,7 @@ syn region mbnCalloutImportant start=":::\s\+{\.callout-important\s*" end=":::$" hi link mbnCalloutImportant SpellBad 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 -hi link mbnCalloutWarning SpellCap - -b:current_syntax = "mbnotes" +hi link mbnCalloutCaution SpellCap