sticky icon indicating copy to clipboard operation
sticky copied to clipboard

Added automatic bullet point "- " when a list is made

Open Nokse22 opened this issue 2 years ago • 5 comments

Basically if the previous line started with "- " and a new line is created it will start with "- " as well.

I know you said that you would add checkboxes, but sometimes a simple list like this is useful too.

stiky-list

Nokse22 avatar Dec 16 '23 13:12 Nokse22

Hey. Lovely work. Thanks!!

I would also suggest adding more characters other than -. We can also allow + and * to be used for lists (as per the markdown spec)

Another issue is that there is no way to "exit the list mode". Modern markdown editors detect if you press enter again and choose to exit the vim mode. Here is an example:

Screencast from 2023-12-16 16-17-05.webm

With this PR as a foundation, we can also support making ordered lists. Thanks again!!

vixalien avatar Dec 16 '23 14:12 vixalien

I'm really glad you like it 😄️. I'll add the other characters and a way to exit pressing return again. I can try adding ordered list creation, but reordering the items with the right numbers when one is deleted sounds very complicated to me.

Nokse22 avatar Dec 16 '23 14:12 Nokse22

but reordering the items with the right numbers when one is deleted sounds very complicated to me.

This is not necessary. I think the better idea is that users update their numbers manually (don't bother yourself)

vixalien avatar Dec 16 '23 15:12 vixalien

Thanks. I will take a look at this tomorrow.

vixalien avatar Dec 16 '23 19:12 vixalien

Found and fixed a bug where \s matched new line and spaces. Regex is hard 😵‍💫️

Nokse22 avatar Dec 17 '23 23:12 Nokse22