-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Desktop: Unindent empty list markup on Enter #2772
Conversation
The wrong issue is linked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works nicely with lists, but not with checkboxes. Any chance you could add that as well?
Added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks.
One last thing: When indented and hitting enter, the cursor should reset to column position 1. e.g.:
Current behavior:
- item
- item
- item (hit enter in this line)
x <---- cursor is here
But it should rather be like this:
- item
- item
- item (hit enter in this line)
x <---- cursor is here
Another possibility is to unindent, which is adopted by Dropbox Paper and Evernote. - item
- item
- item
- x <---- cursor is here (hitting enter again removes `- `) EDIT: As a reference point related to Joplin, TinyMCE uses this behavior too. |
Yes, this would also be a nice solution, but probably more complicated to implement. But maybe Laurent does like your idea better, since people coming from Evernote certainly would feel right at home with that behavior. Let's wait for Laurent's input. |
Hi @sinkuu thanks for the changes. I deleted my comments immediately and was going to try again later, but it seems you saw them anyway! |
and then clear after that. |
@mic704b
I think in this case only after a second Enter, because you might want to continue the list.... |
Looks good. Does this have any effect when entering numbered lists? Have you tested mid-line multiline selections? It's a shame we have no way to automated test this, to make sure no one breaks it in the future. |
@mic704b I made automated tests here: https://github.com/sinkuu/joplin-ace-indent-test/blob/master/spec/indentSpec.js I don't know how I can integrate this to Joplin (if that's a good idea) though. The tests require Ace's |
I think the behavior should be like the way you have alerady described:
This behavior makes the most sense. Then I think we are good to merge. Just waiting for Laurent's input. |
Changed to unindenting behavior. |
Great. This helps a lot with usability. |
@sinkuu that looks really good. Nice work.
I think when it is testing behaviour implemented in Joplin then it makes a lot of sense. (Though it might even make sense when testing required behaviour of dependencies too). However let's see what Laurent thinks, when things calm down a bit. |
The test units you've created look good @sinkuu. Any chance you could add them to this pull request? You could put the test in CliClient/tests and feel free to add any required dependency to CliClient/package.json as dev dependency. |
Done. |
ready to merge? |
Sorry for being late to review this @sinkuu, and unfortunately I see there are some conflicts, due to the recent refactoring of NoteText.jsx, please could you take a look at them? I've moved the previous code from your pull request to a custom hook in |
@sinkuu have you had the time to look into this? I was quite busy and unavailable the last 2 weeks, so I couldn't look into it myself. |
I really would hate seeing this not merged. This made working with lists and checklists a lot easier and better. |
Works perfectly! Thanks! |
@laurent22 can I merge this? |
Yes, if it's working for you then let's merge. Thanks @sinkuu! |
Fixes #2614
cc @Rishgod