diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 38ae7b60aa4..cee7767d3b5 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -107,10 +107,18 @@ class EditorWindow(object): self.text_frame = text_frame = Frame(top) self.vbar = vbar = Scrollbar(text_frame, name='vbar') self.width = idleConf.GetOption('main','EditorWindow','width') - self.text = text = MultiCallCreator(Text)( - text_frame, name='text', padx=5, wrap='none', - width=self.width, - height=idleConf.GetOption('main','EditorWindow','height') ) + text_options = { + 'name': 'text', + 'padx': 5, + 'wrap': 'none', + 'width': self.width, + 'height': idleConf.GetOption('main', 'EditorWindow', 'height')} + if TkVersion >= 8.5: + # Starting with tk 8.5 we have to set the new tabstyle option + # to 'wordprocessor' to achieve the same display of tabs as in + # older tk versions. + text_options['tabstyle'] = 'wordprocessor' + self.text = text = MultiCallCreator(Text)(text_frame, **text_options) self.top.focused_widget = self.text self.createmenubar() diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 87acd5f447e..c76174e0314 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -6,6 +6,9 @@ What's New in IDLE 3.1a1? - Remove port spec from run.py and fix bug where subprocess fails to extract port from command line when warnings are present. +- Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle + mixed space/tab properly. Issue 5120, patch by Guilherme Polo. + - Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8.