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.
This commit is contained in:
Johannes Altmanninger 2022-08-16 19:06:13 +02:00
parent b633b6f9c3
commit 9d362b8b3e

View File

@ -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]+<ret>'
evaluate-commands -itersel %{ require-module %val{selection} }
evaluate-commands -itersel %{ try %{ require-module %val{selection} } }
}}
}