Title: IDLE to provide option for making trailing whitespace visible
Type: enhancement Stage: patch review
Components: IDLE Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, louielu, rhettinger, terry.reedy
Priority: normal Keywords:

Created on 2015-03-14 23:43 by rhettinger, last changed 2017-05-20 18:11 by cheryl.sabella.

Pull Requests
URL Status Linked Edit
PR 1602 closed louielu, 2017-05-16 10:39
PR 1603 closed louielu, 2017-05-16 10:41
PR 1642 closed louielu, 2017-05-18 05:36
PR 1643 open louielu, 2017-05-18 05:51
PR 1644 open louielu, 2017-05-18 05:55
Messages (8)
msg238110 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-03-14 23:43
We have an option to clear trailing whitespace (Format / Strip trailing whitespace) but it isn't always clear when to use it (because the trailing whitespace is invisible).

One thing the can be done is to colorize trailing white space to make it more visible (this idea is inspired by a similar feature in mercurial's colorized diffs).

Another option is put a hook on File / Save to scan for trailing whitespace and offer to remove it (this idea is inspired by the whitespace commit hook used in Python's own source code management).
msg238741 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-03-21 00:00
I agree that this area needs improvement.  'Strip trailing whitespace' should strip trailing blank lines at the end of a file, as well as trailing blank spaces at the end of each line.  Both are required to commit to our repository.

I would like to have a configuration option to always strip trailing blanks, at least for .py files.

I believe the cursor moving from one line to another is an event that is or could be caugth and acted on. If so, trailing spaces could be removed immediately from the line left, and Save would only have to check the current line and the end of the file.  I would rather remove blanks than mark them for later removal.
msg293757 - (view) Author: Louie Lu (louielu) * Date: 2017-05-16 10:42
PR 1602 add trailing whitespace highlight, which using color from error.

PR 1603 add TrimExtension to provide auto trim while saving the file.
msg293910 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-18 06:14
Louie, when you close and open PRs, please give at least a brief explanation.  In particular, how is the new one different?
msg293911 - (view) Author: Louie Lu (louielu) * Date: 2017-05-18 06:18
terry, these close isn't changing anything. But I'm migrating my GitHub account from old one to new one, thus will close the PR and reopen another one, sorry for annoying mailing.
msg293984 - (view) Author: Cheryl Sabella (cheryl.sabella) * Date: 2017-05-19 23:30

Should IDLE library modules get docstrings or is that something you'd rather not have?  Putting the question here because ColorDelegator in doesn't have any docstrings.  I wanted to read some of the IDLE code and I can try to add missing docstrings if it's something that should be done.

msg294005 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-20 05:44
Louie: It appears that old PRs might merge as they are but any change, including an update merge, requires that you close and re-open.  When you re-open, please add "was prnnnn".  It would be easier for me if you redid all the IDLE PRs in a batch or two.

Cheryl: Yes. Idlelib callables need docstrings, especially because they are not otherwise documented.  Based on our work on bdb, I was hoping you would work on IDLE.  I added you to #30290

Some of the colorizer functions are hard to usefully characterize.  This is parly because everything is done by side-effect and most functions have multiple side-effects.  There is a connection between the lack of docstrings and the vestigial nature of test_colorizer.
msg294043 - (view) Author: Cheryl Sabella (cheryl.sabella) * Date: 2017-05-20 18:11
Thanks, Terry!  I'll take a look at 30290.  No need to start with colorizer; it was in this ticket so I referenced it more for convenience than anything.
Date User Action Args
2017-05-20 18:11:39cheryl.sabellasetmessages: + msg294043
2017-05-20 05:44:38terry.reedysetmessages: + msg294005
2017-05-19 23:30:57cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg293984
2017-05-18 06:18:26louielusetmessages: + msg293911
2017-05-18 06:14:19terry.reedysetassignee: terry.reedy
messages: + msg293910
2017-05-18 05:55:39louielusetpull_requests: + pull_request1739
2017-05-18 05:51:59louielusetpull_requests: + pull_request1738
2017-05-18 05:36:15louielusetpull_requests: + pull_request1737
2017-05-16 18:14:07terry.reedysetstage: needs patch -> patch review
versions: + Python 3.6, Python 3.7, - Python 2.7, Python 3.4, Python 3.5
2017-05-16 10:42:44louielusetnosy: + louielu
messages: + msg293757
2017-05-16 10:41:27louielusetpull_requests: + pull_request1694
2017-05-16 10:39:28louielusetpull_requests: + pull_request1693
2015-03-21 00:00:48terry.reedysetversions: + Python 2.7, Python 3.4
nosy: + terry.reedy

messages: + msg238741

stage: needs patch
2015-03-14 23:43:04rhettingercreate