You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/11/07 23:03:51 UTC
[GitHub] jlahoda commented on issue #1012: [NETBEANS-1440] Fixed BadLocationException on triple click to select …
jlahoda commented on issue #1012: [NETBEANS-1440] Fixed BadLocationException on triple click to select …
URL: https://github.com/apache/incubator-netbeans/pull/1012#issuecomment-436810217
Please no. While it might be acceptable to do things like this in some cases, I think it would require a good argument on why that's the best solution. In this case, there appear to be at least two alternative fix candidates:
-LineDocumentUtils.getWordEnd apparently returns an offset that is beyond the document's length, so that might be fixed/changed to not do that. Probably simple, and while it might need some more double-checking, probably the best solution/fix.
-EditorCaret.mouseDragged could replace:
offset = LineDocumentUtils.getWordEnd(lineDoc, offset);
with something like:
offset = Math.min(LineDocumentUtils.getWordEnd(lineDoc, offset), c.getDocument().getLength())
but that feels somewhat hacky (i.e. why getWordEnd even returned the offset that is too high), but would still be better than catching the BadLocationException.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists