This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author epaine
Recipients epaine, taleinat, terry.reedy
Date 2020-08-21.13:26:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org>
In-reply-to
Content
I could not think of a better title so will attempt to explain myself better here. Currently, the IDLE smart backspace will delete multiple whitespace up to the tab width even if it is not at the start of the line. Consider the following examples (where the | is where the cursor is when backspace is clicked - the backticks are just to show code not part of the example text):

`    |abc  def  `: IDLE correctly deletes all four spaces as this is considered the indentation of the code.

`    abc  |def  `: IDLE incorrectly deletes both spaces rather than just one (annoying when correcting a typo). The patch proposes IDLE just deletes one space as is normal/expected behaviour.

`    abc  def  |`: IDLE will currently delete both spaces but the proposed patch will just delete one. This behaviour is up for debate as I personally think all trailing whitespace should be cleared by a backspace, but I also think the proposed behaviour is more consistent than the existing behaviour.

The patch (a PR to be linked shortly after issue creation) is very simple as we already have the compiled `_line_indent_re` which we can check for a full match on all text before the cursor (`chars`).
History
Date User Action Args
2020-08-21 13:26:29epainesetrecipients: + epaine, terry.reedy, taleinat
2020-08-21 13:26:29epainesetmessageid: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org>
2020-08-21 13:26:29epainelinkissue41608 messages
2020-08-21 13:26:29epainecreate