From 5093657ddb76307dc22c95057f6a9a5bbd6577a6 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Sun, 5 Nov 2023 10:33:48 +0100 Subject: [PATCH] feat(nvim): markdown bibtex injection --- nvim/after/queries/markdown/injections.scm | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/nvim/after/queries/markdown/injections.scm b/nvim/after/queries/markdown/injections.scm index eb39d13..7b463bc 100644 --- a/nvim/after/queries/markdown/injections.scm +++ b/nvim/after/queries/markdown/injections.scm @@ -2,21 +2,19 @@ (section - ((paragraph) @p - (#match? @p "^:::bib") - ) - - (#set! injection.language "bibtex") - (#set! injection.include-children) - (#set! injection.combined) -) @injection.content - -(section - ((paragraph) @s (#match? @s "^:::bib")) - . - (paragraph)* - . - ((paragraph) @e (#match? @e ":::")) + [ + ( + ((paragraph) @s (#match? @s "^:::bibtex")) + . + (paragraph)* + . + ((paragraph) @e (#match? @e ":::$")) + ) + ((paragraph) @p + (#match? @p "^:::bibtex") + (#match? @p ":::$") + ) + ] (#set! injection.language "bibtex") (#set! injection.include-children)