Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Jun 1, 2024

Conversation

Nokse22
Copy link
Contributor

@Nokse22 Nokse22 commented Dec 16, 2023

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 Nokse22 changed the title Added automatic bullet point "- " when a list is created Added automatic bullet point "- " when a list is made Dec 16, 2023
@vixalien
Copy link
Owner

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!!

@Nokse22
Copy link
Contributor Author

Nokse22 commented Dec 16, 2023

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.

@vixalien
Copy link
Owner

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
Copy link
Owner

Thanks. I will take a look at this tomorrow.

src/view.ts Outdated Show resolved Hide resolved
src/view.ts Outdated Show resolved Hide resolved
src/view.ts Outdated Show resolved Hide resolved
@Nokse22
Copy link
Contributor Author

Nokse22 commented Dec 17, 2023

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

@vixalien vixalien merged commit f4de2a6 into vixalien:main Jun 1, 2024
2 checks passed
@Nokse22 Nokse22 deleted the automatic-list branch June 5, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants