What would you expect to happen, precisely? Just renumber 3. to 1., or create an empty 2.? How about if the cursor were at the start of DEF, would you expect it to exit the list then or create a new item?
To piggyback on this issue, since it may be quicker to address both of these at once:
I would also prefer that the cursor not go forwards when pressing backspace. It does when I hit enter, creating a new line, and then decide to get rid of it. I’ll also use the pipe character to show the cursor position.
1. ABC|
2. DEF
Then I hit enter and it does this:
1. ABC
2. |
3. DEF
I hit backspace and it just deletes the space:
1. ABC
2.|
3. DEF
I hit backspace a second time, and now it replaces the whole 2. with spaces, including the space that I deleted, causing the cursor to jump forward:
1. ABC
|
3. DEF
Finally I hit backspace again and it deletes the three spaces, and I hit it again and it deletes the newline.
Two ideas:
A: When I hit backspace the first time, replace all three in 2. with spaces. This reduces the number of times I need to hit backspace and keeps the cursor from going forward.
B: When I hit backspace the first time, delete all three characters. This would make hitting enter and backspace an alternative to hitting shift enter. Possibly make it so shift enter keeps the indentation but doesn’t add a new number. Currently shift-enter breaks out of the list.
ABC
DEF
BTW I appreciate that it’s simple for a developer to change this behavior without having to patch the library!
@Danon It seems the old behavior was intentional (there was a test checking it), but I guess that on second thought I also prefer the behavior your describe. Implemented in this patch.
@benatkin Piggybacking on vaguely related threads is generally not a great idea for clarity—next time, I’d prefer a separate thread. The thing you describe seems to have been unintentional, and was fixed in this patch.
But there’s a space missing, for some reason. 1. |ABC\n2. DEF, and you press enter:
you get 1.\n2. |ABC\n2. DEF
instead of 1. \n2. |ABC\n2. DEF.
It’s not really an issue for me, but it feels wierd to me that if you put cursor after an item, press enter and create a new item, you get x. (x, ., space). Buf if you put cursor between x. and an item, and the newly created item above doesn’t have the space.
Shouldn’t it either have spaces both times, or not have spaces both times?