summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/editor.py
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2019-06-02 18:56:47 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2019-06-02 18:56:47 (GMT)
commit6bdc4dee01788599808c7858e2fe9fdd72cf6792 (patch)
tree9799a90d1b34dcb30bb42edb9a9c5cf35a37fc35 /Lib/idlelib/editor.py
parent5df4025f42b30aca72f441899b361f748c304c57 (diff)
downloadcpython-6bdc4dee01788599808c7858e2fe9fdd72cf6792.zip
cpython-6bdc4dee01788599808c7858e2fe9fdd72cf6792.tar.gz
cpython-6bdc4dee01788599808c7858e2fe9fdd72cf6792.tar.bz2
bpo-35610: IDLE - Replace .context_use_ps1 with .prompt_last_line (GH-11307)
Changes in bpo- 31858 made the less informative 'context_use_ps1' redundant.
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r--Lib/idlelib/editor.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index 8326032..89b7239 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -228,10 +228,6 @@ class EditorWindow(object):
self.indentwidth = self.tabwidth
self.set_notabs_indentwidth()
- # If context_use_ps1 is true, parsing searches back for a ps1 line;
- # else searches for a popular (if, def, ...) Python stmt.
- self.context_use_ps1 = False
-
# When searching backwards for a reliable place to begin parsing,
# first start num_context_lines[0] lines back, then
# num_context_lines[1] lines back if that didn't work, and so on.
@@ -1337,14 +1333,13 @@ class EditorWindow(object):
# open/close first need to find the last stmt
lno = index2line(text.index('insert'))
y = pyparse.Parser(self.indentwidth, self.tabwidth)
- if not self.context_use_ps1:
+ if not self.prompt_last_line:
for context in self.num_context_lines:
startat = max(lno - context, 1)
startatindex = repr(startat) + ".0"
rawtext = text.get(startatindex, "insert")
y.set_code(rawtext)
bod = y.find_good_parse_start(
- self.context_use_ps1,
self._build_char_in_string_func(startatindex))
if bod is not None or startat == 1:
break