summaryrefslogtreecommitdiff
path: root/Lib/idlelib/squeezer.py
diff options
context:
space:
mode:
authorTal Einat <532281+taleinat@users.noreply.github.com>2021-04-29 01:27:55 +0300
committerGitHub <noreply@github.com>2021-04-28 18:27:55 -0400
commit15d386185659683fc044ccaa300aa8cd7d49cc1a (patch)
tree6fac7df4ac125b39648d8f0d7fbb008212dc6ba8 /Lib/idlelib/squeezer.py
parent103d5e420dd90489933ad9da8bb1d6008773384d (diff)
downloadcpython-git-15d386185659683fc044ccaa300aa8cd7d49cc1a.tar.gz
bpo-37903: IDLE: Shell sidebar with prompts (GH-22682)
The first followup will change shell indents to spaces. More are expected. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/squeezer.py')
-rw-r--r--Lib/idlelib/squeezer.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/idlelib/squeezer.py b/Lib/idlelib/squeezer.py
index 3046d803b7..929c3fd3a5 100644
--- a/Lib/idlelib/squeezer.py
+++ b/Lib/idlelib/squeezer.py
@@ -160,8 +160,10 @@ class ExpandingButton(tk.Button):
if not confirm:
return "break"
- self.base_text.insert(self.text.index(self), self.s, self.tags)
+ index = self.text.index(self)
+ self.base_text.insert(index, self.s, self.tags)
self.base_text.delete(self)
+ self.editwin.on_squeezed_expand(index, self.s, self.tags)
self.squeezer.expandingbuttons.remove(self)
def copy(self, event=None):
@@ -285,12 +287,10 @@ class Squeezer:
"""
return count_lines_with_wrapping(s, self.editwin.width)
- def squeeze_current_text_event(self, event):
- """squeeze-current-text event handler
+ def squeeze_current_text(self):
+ """Squeeze the text block where the insertion cursor is.
- Squeeze the block of text inside which contains the "insert" cursor.
-
- If the insert cursor is not in a squeezable block of text, give the
+ If the cursor is not in a squeezable block of text, give the
user a small warning and do nothing.
"""
# Set tag_name to the first valid tag found on the "insert" cursor.