Page 2 of 2
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 08:08
by main Alexey
>then what's the use of ed.set_prop(PROP_CODETREE_SUBLEXER, Ture)?
It's use is for lexers without Pascal tree-helpers. for ex: PHP lexer with inclusion of JS and HTML blocks. or: HTML lexer with inclusion of JS block or CSS block.
I find that the "# sec5" in fenced-block will not be recognized as Markdown title
because this title is inside fenced block.
hat means if I define some additional lexer for Markdown,it will not be recognized in fenced-block?
yes. but you cannot 'define additional lexer for Markdown'. Markdown supports sublexers listed in the file
data/lexlib/aliases.ini
where can I find the description about how to make pascal tree-helper for cudatext?
See example codes in src:
treehelper_ini.pas
treehelper_markdown.pas
treehelper_mediawiki.pas
treehelper_rest.pas
treehelper_textile.pas
treehelper_wikidpad.pas
and
treehelpers_proc.pas - this 'registers' treehelpers.
that will be faster than python tree helper, right?
of course!
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 10:04
by SamC
Any api method to directly add or delete a node in codetree?
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 10:11
by main Alexey
Yes, API allows it.
- get handle of codetree: self.h_tree = app_proc(PROC_GET_CODETREE, '')
- handle event on_state, state==APPSTATE_CODETREE_AFTER_FILL
- add any treeview data using self.h_tree using tree_proc()
Example plugin:
https://github.com/CudaText-addons/cuda_code_tree_x
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 15:26
by SamC
Thanks, I wrote a python plugin "cuda_tree_markdown" to try to show some additional codetree node, but cuda raise the warning below:
NOTE: Plugin cuda_tree_markdown is in ignore-list, please remove it
How to active the user defined codetree for markdown?
Re: How to use PROP_CODETREE_SUBLEXER to show sublexer code in codetree?
Posted: 23.03.2024 15:28
by main Alexey
'cuda_tree_markdown' is a fixed name of old (deleted) treehelper. modify it a little so it will be enabled.
https://github.com/CudaText-addons/cuda_tree_markdown