Commit 029a6a68 authored by Guido van Rossum's avatar Guido van Rossum

Much improved autoindent and handling of tabs,

by Tim Peters.
parent c1bb6935
This diff is collapsed.
......@@ -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()
......@@ -575,7 +580,6 @@ class EditorWindow:
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").
......
......@@ -291,7 +291,7 @@ class PyShell(OutputWindow):
__builtin__.quit = __builtin__.exit = "To exit, type Ctrl-D."
self.auto = self.extensions["AutoIndent"] # Required extension
self.auto.config(prefertabs=1)
self.auto.config(usetabs=1, indentwidth=8)
text = self.text
text.configure(wrap="char")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment