3636from idlelib .delegator import Delegator
3737from idlelib import debugger
3838from idlelib import debugger_r
39- from idlelib .editor import EditorWindow , fixwordbreaks
39+ from idlelib .editor import EditorWindow
4040from idlelib .filelist import FileList
4141from idlelib .outwin import OutputWindow
4242from idlelib import replace
4343from idlelib import rpc
4444from idlelib .run import idle_formatwarning , StdInputFile , StdOutputFile
4545from idlelib .undo import UndoDelegator
46+ from idlelib .util import fix_word_breaks
4647
4748# Default for testing; defaults to True in main() for running.
4849use_subprocess = False
@@ -882,9 +883,9 @@ def __init__(self, flist=None):
882883 if ms [2 ][0 ] != "shell" :
883884 ms .insert (2 , ("shell" , "She_ll" ))
884885 self .interp = ModifiedInterpreter (self )
885- if flist is None :
886+ if flist is None : # TODO possible? root and flist in main.
886887 root = Tk ()
887- fixwordbreaks (root )
888+ fix_word_breaks (root )
888889 root .withdraw ()
889890 flist = PyShellFileList (root )
890891
@@ -1453,17 +1454,6 @@ def on_squeezed_expand(self, index, text, tags):
14531454 self .shell_sidebar .update_sidebar ()
14541455
14551456
1456- def fix_x11_paste (root ):
1457- "Make paste replace selection on x11. See issue #5124."
1458- if root ._windowingsystem == 'x11' :
1459- for cls in 'Text' , 'Entry' , 'Spinbox' :
1460- root .bind_class (
1461- cls ,
1462- '<<Paste>>' ,
1463- 'catch {%W delete sel.first sel.last}\n ' +
1464- root .bind_class (cls , '<<Paste>>' ))
1465-
1466-
14671457usage_msg = """\
14681458
14691459USAGE: idle [-deins] [-t title] [file]*
@@ -1523,6 +1513,7 @@ def main():
15231513 from platform import system
15241514 from idlelib import testing # bool value
15251515 from idlelib import macosx
1516+ from idlelib .util import fix_scaling , fix_x11_paste
15261517
15271518 global flist , root , use_subprocess
15281519
@@ -1608,7 +1599,6 @@ def main():
16081599 NoDefaultRoot ()
16091600 root = Tk (className = "Idle" )
16101601 root .withdraw ()
1611- from idlelib .run import fix_scaling
16121602 fix_scaling (root )
16131603
16141604 # set application icon
@@ -1630,7 +1620,7 @@ def main():
16301620 root .wm_iconphoto (True , * icons )
16311621
16321622 # start editor and/or shell windows:
1633- fixwordbreaks (root )
1623+ fix_word_breaks (root )
16341624 fix_x11_paste (root )
16351625 flist = PyShellFileList (root )
16361626 macosx .setupApp (root , flist )
0 commit comments