From 9d362b8b3e9be6c89ce880144167f8b2f9ab70c1 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 16 Aug 2022 19:06:13 +0200 Subject: [PATCH] rc markdown: fix loading language highlighter module given multiple code blocks After opening a markdown file ```b ``` ```c int main() {} ``` markdown-load-languages will run an "evaluate-commands -itersel". The first selection makes us run "require-module b", which fails because that module can't be found. Since -itersel only ignores the "no selection remaining" error we fail to run "require-module c". Fix this by ignoring errors. --- rc/filetype/markdown.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index 3aaf1c45..d6d95b14 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -124,7 +124,7 @@ define-command -hidden markdown-indent-on-new-line %{ define-command -hidden markdown-load-languages %{ evaluate-commands -draft %{ try %{ execute-keys 'gtGbGls```\h*\{?[.=]?\K[^}\s]+' - evaluate-commands -itersel %{ require-module %val{selection} } + evaluate-commands -itersel %{ try %{ require-module %val{selection} } } }} }