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 <[email protected]>
<http://bugs.python.org/issue21694>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com