Yaqiang / jythonconsole

Automatically exported from code.google.com/p/jythonconsole
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Work around bug that sometimes caretPoint is None #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The bug noted in console.py:

> # BUG: sometimes caretPoint is None
> # To duplicate type "java.aw" and hit '.' to complete selection while popup 
is visible

is caused by JTextPane.getCaret().getMagicCaretPosition() sometimes returning 
null.  That is probably a bug in Java, but work around it to avoid ugly output 
to stderr: keep track of the last caretPosition and, if the new position is 
None, use the old position instead.  If no valid position has *ever* been seen, 
use Point(0,0).  It's not perfect, but it is definitely an improvement on the 
status quo.

Original issue reported on code.google.com by mrhagger@gmail.com on 19 Aug 2013 at 3:31

Attachments: