[issue21694] IDLE - Test ParenMatch
Tal Einat
report at bugs.python.org
Sat Jun 14 10:35:28 CEST 2014
Tal Einat added the comment:
Progress: As a hack for exploring this issue, I fixed this in the Shell window by having ParenMatch instantiate HyperParser in such a way that it parses the entirety of the current input. In ParenMatch.flash_paren_event(), I added:
from idlelib.PyShell import PyShell
if isinstance(self.editwin, PyShell):
hp = HyperParser(self.editwin, "end-1c")
hp.set_index("insert")
indices = hp.get_surrounding_brackets()
else:
<current behavior>
With this the given example works as expected in the Shell window, i.e. the entire expression is highlighted when the cursor is after the first bracket and pressing ^0.
I still need to find a less hackish way to do this which will also work for editor windows.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21694>
_______________________________________
More information about the Python-bugs-list
mailing list