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
@@ -881,9 +882,9 @@ def __init__(self, flist=None):
881882 if ms [2 ][0 ] != "shell" :
882883 ms .insert (2 , ("shell" , "She_ll" ))
883884 self .interp = ModifiedInterpreter (self )
884- if flist is None :
885+ if flist is None : # TODO possible? root and flist in main.
885886 root = Tk ()
886- fixwordbreaks (root )
887+ fix_word_breaks (root )
887888 root .withdraw ()
888889 flist = PyShellFileList (root )
889890
@@ -1452,17 +1453,6 @@ def on_squeezed_expand(self, index, text, tags):
14521453 self .shell_sidebar .update_sidebar ()
14531454
14541455
1455- def fix_x11_paste (root ):
1456- "Make paste replace selection on x11. See issue #5124."
1457- if root ._windowingsystem == 'x11' :
1458- for cls in 'Text' , 'Entry' , 'Spinbox' :
1459- root .bind_class (
1460- cls ,
1461- '<<Paste>>' ,
1462- 'catch {%W delete sel.first sel.last}\n ' +
1463- root .bind_class (cls , '<<Paste>>' ))
1464-
1465-
14661456usage_msg = """\
14671457
14681458USAGE: idle [-deins] [-t title] [file]*
@@ -1522,6 +1512,7 @@ def main():
15221512 from platform import system
15231513 from idlelib import testing # bool value
15241514 from idlelib import macosx
1515+ from idlelib .util import fix_scaling , fix_x11_paste
15251516
15261517 global flist , root , use_subprocess
15271518
@@ -1607,7 +1598,6 @@ def main():
16071598 NoDefaultRoot ()
16081599 root = Tk (className = "Idle" )
16091600 root .withdraw ()
1610- from idlelib .run import fix_scaling
16111601 fix_scaling (root )
16121602
16131603 # set application icon
@@ -1629,7 +1619,7 @@ def main():
16291619 root .wm_iconphoto (True , * icons )
16301620
16311621 # start editor and/or shell windows:
1632- fixwordbreaks (root )
1622+ fix_word_breaks (root )
16331623 fix_x11_paste (root )
16341624 flist = PyShellFileList (root )
16351625 macosx .setupApp (root , flist )
0 commit comments