changeset: 83878:b56ae3f878cb parent: 83875:96c842873c30 parent: 83877:3735b4e0fc7c user: Roger Serwy date: Mon May 20 22:16:53 2013 -0500 files: Lib/idlelib/EditorWindow.py Misc/NEWS description: #14146: merge with 3.3. diff -r 96c842873c30 -r b56ae3f878cb Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Mon May 20 15:39:11 2013 -0700 +++ b/Lib/idlelib/EditorWindow.py Mon May 20 22:16:53 2013 -0500 @@ -340,6 +340,36 @@ self.askinteger = tkSimpleDialog.askinteger self.showerror = tkMessageBox.showerror + self._highlight_workaround() # Fix selection tags on Windows + + def _highlight_workaround(self): + # On Windows, Tk removes painting of the selection + # tags which is different behavior than on Linux and Mac. + # See issue14146 for more information. + if not sys.platform.startswith('win'): + return + + text = self.text + text.event_add("<>", "") + text.event_add("<>", "") + def highlight_fix(focus): + sel_range = text.tag_ranges("sel") + if sel_range: + if focus == 'out': + HILITE_CONFIG = idleConf.GetHighlight( + idleConf.CurrentTheme(), 'hilite') + text.tag_config("sel_fix", HILITE_CONFIG) + text.tag_raise("sel_fix") + text.tag_add("sel_fix", *sel_range) + elif focus == 'in': + text.tag_remove("sel_fix", "1.0", "end") + + text.bind("<>", + lambda ev: highlight_fix("out")) + text.bind("<>", + lambda ev: highlight_fix("in")) + + def _filename_to_unicode(self, filename): """convert filename to unicode in order to display it in Tk""" if isinstance(filename, str) or not filename: diff -r 96c842873c30 -r b56ae3f878cb Misc/NEWS --- a/Misc/NEWS Mon May 20 15:39:11 2013 -0700 +++ b/Misc/NEWS Mon May 20 22:16:53 2013 -0500 @@ -351,6 +351,8 @@ IDLE ---- +- Issue #14146: Highlight source line while debugging on Windows. + - Issue #17838: Allow sys.stdin to be reassigned. - Issue #13495: Avoid loading the color delegator twice in IDLE.

AltStyle によって変換されたページ (->オリジナル) /