diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index c76db20c58792d..100efed95951e8 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -433,6 +433,7 @@ def set_status_bar(self): # Insert some padding to avoid obscuring some of the statusbar # by the resize widget. self.status_bar.set_label('_padding1', ' ', side=RIGHT) + self.status_bar.set_label('selected', '', side=RIGHT) self.status_bar.set_label('column', 'Col: ?', side=RIGHT) self.status_bar.set_label('line', 'Ln: ?', side=RIGHT) self.status_bar.pack(side=BOTTOM, fill=X) @@ -446,6 +447,8 @@ def set_line_and_column(self, event=None): line, column = self.text.index(INSERT).split('.') self.status_bar.set_label('column', 'Col: %s' % column) self.status_bar.set_label('line', 'Ln: %s' % line) + chars = len(self.text.get(SEL_FIRST, SEL_LAST)) + self.status_bar.set_label('selected', '%d selected' % chars if chars else '') """ Menu definitions and functions. diff --git a/Misc/NEWS.d/next/IDLE/2022-05-15-17-46-13.gh-issue-92822.tjcUfw.rst b/Misc/NEWS.d/next/IDLE/2022-05-15-17-46-13.gh-issue-92822.tjcUfw.rst new file mode 100644 index 00000000000000..0dacf3886740b0 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2022-05-15-17-46-13.gh-issue-92822.tjcUfw.rst @@ -0,0 +1 @@ +Add "selected" label to the IDLE statusbar. Label is updated to show selected number of characters in the editor.