Page 2 of 2

Re: markdown editing plugin list items

Posted: 28.01.2024 13:40
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.

Re: markdown editing plugin list items

Posted: 29.01.2024 01:23
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!

Re: markdown editing plugin list items

Posted: 29.01.2024 05:39
by main Alexey
>where to see the description of int key code?Ie,to kown 9 means tab key?

file py/cudatext_keys.py .

Re: markdown editing plugin list items

Posted: 29.01.2024 05:58
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.