mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LookupOffsets.updateLookupStart: ensure offset bounds instead of assertions (EA-49467, EA-47632)
This commit is contained in:
@@ -51,10 +51,7 @@ public class LookupOffsets {
|
||||
private void updateLookupStart(int minPrefixLength) {
|
||||
int offset = getPivotOffset();
|
||||
int start = offset - minPrefixLength - myAdditionalPrefix.length() + myRemovedPrefix;
|
||||
if (start < 0) {
|
||||
LOG.error("Invalid start offset: o=" + offset + ", mpl=" + minPrefixLength + ", ap=" + myAdditionalPrefix + ", rp=" + myRemovedPrefix);
|
||||
return;
|
||||
}
|
||||
start = Math.max(Math.min(start, myEditor.getDocument().getTextLength()), 0);
|
||||
if (myLookupStartMarker != null) {
|
||||
if (myLookupStartMarker.isValid() && myLookupStartMarker.getStartOffset() == start && myLookupStartMarker.getEndOffset() == start) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user