Page 1 of 2
How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 02:05
by SamC
Hello,
When using markdown,I want to show the codetree in codeblock in additional to the markdown codetree. After checking the api,I find maybe the following method is helpful:
ed.set_prop(PROP_CODETREE_SUBLEXER, True)
However,after using that,the sublexer codetree didn't appear in codetree sidebar. Could you please give some guidance for how to do this?
Thanks!
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 04:37
by main Alexey
this property allows sublexer (of current lexer, ie Markdown) to show sublexer nodes in the code-tree.
but Markdown don't have sublexer with code-tree support, or it does?
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 04:50
by SamC
main Alexey wrote: ↑23.03.2024 04:37
this property allows sublexer (of current lexer, ie Markdown) to show sublexer nodes in the code-tree.
but Markdown don't have sublexer with code-tree support, or it does?
I use get_sublexer_range and see that code in codeblock will be token as sublexer (like python,JavaScript),but the codetree in codeblock can't been seen in sidebar.
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 04:50
by SamC
main Alexey wrote: ↑23.03.2024 04:37
this property allows sublexer (of current lexer, ie Markdown) to show sublexer nodes in the code-tree.
but Markdown don't have sublexer with code-tree support, or it does?
I use get_sublexer_range and see that code in codeblock will be token as sublexer (like python,JavaScript),but the codetree in codeblock can't been seen in sidebar.
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 04:52
by main Alexey
I don't get it. give me the full lexer .lcf file (if it 's changed) and exammple markdown file.
only _changed_ Markdown lexer will be able to show sublexer nodes.
in the SynWrite's "Lexer properties" dialog you can see 'Sublexers' tab which setups included sublexers.
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 07:08
by SamC
Maybe I misunderstand the usage of it.
For a file below,I want to show the python codetree in Sec3 in together with the original Markdown code tree,how to do that?
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 07:12
by main Alexey
now I see what you mean. fenced code-block in Markdown.
I will study this. currently I don't know.
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 07:13
by main Alexey
it cannot be solved. reason: code-tree is built here NOT using EControl engine, but using Pascal tree-helper for Markdown.
Pascal tree-helpers do not allow sublexer nodes. sorry.
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 07:58
by SamC
I see,then what's the use of ed.set_prop(PROP_CODETREE_SUBLEXER, Ture)? The description says: "PROP_CODETREE_SUBLEXER: bool: enable code-tree to show nodes from sublexer(s) of current lexer."
Sublexer means the user defined additional lexer for Markdown?
I find that the "# sec5" in fenced-block will not be recognized as Markdown title,that means if I define some additional lexer for Markdown,it will not be recognized in fenced-block?
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 08:05
by SamC
BTW,where can I find the description about how to make pascal tree-helper for cudatext?I remember I've seen that before,that will be faster than python tree helper, right?