plugin Markdown Editing

Plugins for SynWrite and CudaText...
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: markdown editing plugin list items

Post by main Alexey »

I can also make the work for unnumbered-list the same as for numbered list.
ie disable toggling of bullet char by tab-key.
so tab-key will only indent.
not sure.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Re: markdown editing plugin list items

Post by SamC »

main Alexey wrote: 28.01.2024 13:40 I can also make the work for unnumbered-list the same as for numbered list.
ie disable toggling of bullet char by tab-key.
so tab-key will only indent.
not sure.
Maybe I Figure it out:
For original idea,the tab character is used to make multi-level list,thus the tab key will generate intent and bullet/number at same time. If the list is numbered and tab key is pressed,it will generate the new sub-level numbered list, so the number is reset to "1. ".
In code, the indent size is get by the code below:

Code: Select all

indent_size=ed_self.get_prop(PROP_INDENT_SIZE)
And in settings,the indent_size is 0 for my case(maybe because I set the tab_size in md lexer),thus the indent can't be generated.

Code: Select all

  //Indentation for Indent/Unindent commands.
  //  N>0: indent is N spaces
  //  N<0: indent is abs(N) tabs
  //  N=0: indent is from options "tab_size" and "tab_spaces"
  "indent_size": 0,
Now, I changed the code as below,the multi-level list is OK now.

Code: Select all

indent_size=4
BTW:
where to see the description of int key code?Ie,to kown 9 means tab key?

Thanks!
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: markdown editing plugin list items

Post by main Alexey »

>where to see the description of int key code?Ie,to kown 9 means tab key?

file py/cudatext_keys.py .
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Re: markdown editing plugin list items

Post by main Alexey »

fixed the plugin: "indent_size" value 0 and <0 is reading OK now.
small bug is left: after many presses of Tab after "- ", caret goes righter by several chars.
maybe you can fix this bug.
Post Reply