summaryrefslogtreecommitdiffstats
path: root/Tools/idle/EditorWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/idle/EditorWindow.py')
-rw-r--r--Tools/idle/EditorWindow.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py
index 8b6a0b4..13cfc22 100644
--- a/Tools/idle/EditorWindow.py
+++ b/Tools/idle/EditorWindow.py
@@ -100,7 +100,7 @@ class EditorWindow:
self.vbar = vbar = Scrollbar(top, name='vbar')
self.text = text = Text(top, name='text', padx=5,
foreground=cprefs.CNormal[0],
- background=cprefs.CNormal[1],
+ background=cprefs.CNormal[1],
highlightcolor=cprefs.CHilite[0],
highlightbackground=cprefs.CHilite[1],
insertbackground=cprefs.CCursor[1],
@@ -134,6 +134,7 @@ class EditorWindow:
text['yscrollcommand'] = vbar.set
if sys.platform[:3] == 'win':
text['font'] = ("lucida console", 8)
+# text['font'] = ("courier new", 10)
text.pack(side=LEFT, fill=BOTH, expand=1)
text.focus_set()
@@ -173,6 +174,10 @@ class EditorWindow:
self.wmenu_end = end
WindowList.register_callback(self.postwindowsmenu)
+ if self.extensions.has_key('AutoIndent'):
+ self.extensions['AutoIndent'].set_indentation_params(
+ self.ispythonsource(filename))
+
def wakeup(self):
if self.top.wm_state() == "iconic":
self.top.wm_deiconify()
@@ -323,7 +328,7 @@ class EditorWindow:
import ClassBrowser
ClassBrowser.ClassBrowser(self.flist, base, [head])
self.text["cursor"] = save_cursor
-
+
def open_path_browser(self, event=None):
import PathBrowser
PathBrowser.PathBrowser(self.flist)
@@ -558,24 +563,23 @@ class EditorWindow:
else:
menu.add_command(label=label, underline=underline,
command=command, accelerator=accelerator)
-
+
def getvar(self, name):
var = self.getrawvar(name)
if var:
return var.get()
-
+
def setvar(self, name, value, vartype=None):
var = self.getrawvar(name, vartype)
if var:
var.set(value)
-
+
def getrawvar(self, name, vartype=None):
var = self.vars.get(name)
if not var and vartype:
self.vars[name] = var = vartype(self.text)
return var
-
def prepstr(s):
# Helper to extract the underscore from a string,
# e.g. prepstr("Co_py") returns (2, "Copy").