Message375760
Your example is 4 spaces, 3 (non-space) chars, 2 spaces, 3 chars, 2 spaces.
With the cursor after the 2 internal spaces, backspace deletes 1 space, not 2. However, with the first block expanded from 3 chars to 4, backspace deletes both spaces.
Without out looking at the code, the uniform rule, when deleting a space to the left with Backspace, seems to be "Delete up to Indent spaces, stopping at the first non-space char or at a slice position that is a multiple of Indent." Tabs in the text are interpreted as as many spaces needed to get to a position that is a multiple of 8. I tested this with longer space runs and with Indent set to 5.
Deleting a space with Delete always deletes one char. So single space deletion is available anywhere.
I consider the current behavior as a defensible design decision for a PEP 8 oriented Python code editor. Multiple space deletion is a plus when deleting large space blocks, a minus when lining up multiple continuation lines. While I could imagine turning off multiple space delete for internal blocks, I would rather trailing blocks be deleted all at once. All in all, I consider a change fairly low priority at the moment.
The prompt is 4 chars: '>>> '. Anything after that is an indent and should be treated as such. It is the first line of a mini 'file' with one statement. Treating this line differently would be a bug. |
|
Date |
User |
Action |
Args |
2020-08-21 16:55:07 | terry.reedy | set | recipients:
+ terry.reedy, taleinat, epaine |
2020-08-21 16:55:07 | terry.reedy | set | messageid: <1598028907.87.0.0896052094903.issue41608@roundup.psfhosted.org> |
2020-08-21 16:55:07 | terry.reedy | link | issue41608 messages |
2020-08-21 16:55:07 | terry.reedy | create | |
|