summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2002-07-11 04:33:41 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2002-07-11 04:33:41 (GMT)
commitdc1e70987f49aa23bf1d07f32c476edeba0cec30 (patch)
treea60e6a0dd2e6e3ce597b2860b74375d9827352f6 /Lib/idlelib/EditorWindow.py
parent0c08864fbbdf87a09ee1b0042344f87eeea07a3c (diff)
downloadcpython-dc1e70987f49aa23bf1d07f32c476edeba0cec30.zip
cpython-dc1e70987f49aa23bf1d07f32c476edeba0cec30.tar.gz
cpython-dc1e70987f49aa23bf1d07f32c476edeba0cec30.tar.bz2
1. Prevent Undo before IOmark in PyShell.PyShell
2. Consolidate Undo code in EditorWindow.EditorWindow 3. Remove Formatting and Run menus from PyShell
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index a7aa185..c8b0d41 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -151,10 +151,8 @@ class EditorWindow:
text.bind("<<open-path-browser>>", self.open_path_browser)
self.set_status_bar()
-
vbar['command'] = text.yview
vbar.pack(side=RIGHT, fill=Y)
-
text['yscrollcommand'] = vbar.set
fontWeight='normal'
if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
@@ -168,30 +166,34 @@ class EditorWindow:
self.per = per = self.Percolator(text)
if self.ispythonsource(filename):
- self.color = color = self.ColorDelegator(); per.insertfilter(color)
+ self.color = color = self.ColorDelegator()
+ per.insertfilter(color)
##print "Initial colorizer"
else:
##print "No initial colorizer"
self.color = None
- self.undo = undo = self.UndoDelegator(); per.insertfilter(undo)
+
+ self.undo = undo = self.UndoDelegator()
+ per.insertfilter(undo)
+ text.undo_block_start = undo.undo_block_start
+ text.undo_block_stop = undo.undo_block_stop
+ undo.set_saved_change_hook(self.saved_change_hook)
+
+ # IOBinding implements file I/O and printing functionality
self.io = io = self.IOBinding(self)
+ io.set_filename_change_hook(self.filename_change_hook)
+
#create the Recent Files submenu
self.menuRecentFiles=Menu(self.menubar)
self.menudict['file'].insert_cascade(3,label='Recent Files',
underline=0,menu=self.menuRecentFiles)
self.UpdateRecentFilesList()
- text.undo_block_start = undo.undo_block_start
- text.undo_block_stop = undo.undo_block_stop
- undo.set_saved_change_hook(self.saved_change_hook)
- io.set_filename_change_hook(self.filename_change_hook)
-
if filename:
if os.path.exists(filename):
io.loadfile(filename)
else:
io.set_filename(filename)
-
self.saved_change_hook()
self.load_extensions()