Message267136
Thank you David, that does help. Your comment emphasizes that on other systems and many other X-11 apps, the user already chooses 'replace' versus 'insert' by selecting a replacement or not. I presume the 'selection buffer' you refer to is different from the 'clipboard' (or whatever linux calls it). Otherwise, Roger's patch would not work and I assume he tested it.
Simply applying Roger's patch, in 3.6, would be **MUCH** easier than adding a new option. I could even add a line to the sign-on message: "Paste now replaces selected text. Use undo to correct mistakes."
Assuming the patch does work, here is a workaround for releases that lack it. Create in Lib/idlelib a file called, for instance @MYPATCHES.txt and insert with the following, to remind what to do after upgrading to a new bugfix release.
---
To make paste replace selection, insert the following 3 lines at the top (after the def line) of EditorWindow.paste, about line 600, in file EditorWindow.py (3.5 and before) or editor.py (3.6 and after).
sel = self.text.tag_ranges("sel")
if sel:
self.text.delete(*sel) # issue5124
---
Save and then follow the instruction to patch the editor file. If doing the edit in IDLE, hit F5 to test the patched EditorWindow. |
|
Date |
User |
Action |
Args |
2016-06-03 18:57:15 | terry.reedy | set | recipients:
+ terry.reedy, gpolo, ned.deily, roger.serwy, weeble, r.david.murray, Todd.Rovito, Mark.Young, serhiy.storchaka, Guilherme.Simões |
2016-06-03 18:57:15 | terry.reedy | set | messageid: <1464980235.16.0.345718154921.issue5124@psf.upfronthosting.co.za> |
2016-06-03 18:57:15 | terry.reedy | link | issue5124 messages |
2016-06-03 18:57:14 | terry.reedy | create | |
|