Better indentation after first line of string continuation.

IDLEfork Patch 681992, Noam Raphael
This commit is contained in:
Kurt B. Kaiser 2005-11-15 07:20:06 +00:00
parent 6b34789046
commit b61602c968
3 changed files with 20 additions and 5 deletions

View file

@ -1078,8 +1078,12 @@ class EditorWindow(object):
c = y.get_continuation_type()
if c != PyParse.C_NONE:
# The current stmt hasn't ended yet.
if c == PyParse.C_STRING:
# inside a string; just mimic the current indent
if c == PyParse.C_STRING_FIRST_LINE:
# after the first line of a string; do not indent at all
pass
elif c == PyParse.C_STRING_NEXT_LINES:
# inside a string which started before this line;
# just mimic the current indent
text.insert("insert", indent)
elif c == PyParse.C_BRACKET:
# line up with the first (if any) element of the