Phil (and everyone else): PLEASE submit patches with 4 space indents and no tabs and no trailing spaces. Even if the code below runs in the CPython interpreter,
self.undo = mockUndoDelegator() <8 spaces>
<4 spaces>
def get_selection_indices(self): <4 spaces>
first = self.text.index('1.0') <4 spaces, 1 tab >
class mockUndoDelegator:
def undo_block_start(*args): <1 tab>
pass <2 tabs>
the CPython repository whitespace pre-commit will say this:
remote: - file Lib/idlelib/idle_test/test_text.py is not whitespace-normalized in 979905090779
remote: * Run Tools/scripts/reindent.py on .py files or Tools/scripts /reindent-rst.py on .rst files listed above
remote: * and commit that change before pushing to this repo.
remote: transaction abort!
remote: rollback completed
as happened with the mock_tk/test_text patch. I already fixed this file, but next time...
About no trailing whitespace: that is not an option when committing, so I will change the string literal to use explicit \n and implicit catenation, as in 'ab \n' 'cd\n' == 'ab \ncd\n'. This will make the trailing ws visible anyway.
The way to not get the tk=added \n is to use 'insert' rather than 'end', as inself.text.get('1.0','insert'). 'Insert' is the end of user input, before the guard.
Will commit patch soon. |