Tab-indented code block rendering issue

Post Reply
katwalk
Posts: 27
Joined: 24.05.2025 02:08

Tab-indented code block rendering issue

Post by katwalk »

I’m using the Markdown lexer and seeing flaky rendering for tab-indented code blocks.

Take a look at this screen recording. As I type, the code block highlighting randomly drops out.
https://streamable.com/pv4t27

My questions:
Is this a lexer bug?
If not, the trigger rules for tab-indented code blocks are really confusing.
main Alexey
Posts: 2708
Joined: 25.08.2021 18:15

Re: Tab-indented code block rendering issue

Post by main Alexey »

it has the reason.

a. regex for 'codeblock' rule is

Code: Select all

      DisplayName = 'Codeblock indented'
      Expression = '(?<=^$\n)(^(\x20{4,}|\x09{1,})[^`<>:\n\r].*$\n)+ ^$'
so you need empty line above code + empty line below.

b. coloring changes when edition touches 1st line of block.
katwalk
Posts: 27
Joined: 24.05.2025 02:08

Re: Tab-indented code block rendering issue

Post by katwalk »

Thank you for the explanation, I finally understand.
Post Reply