mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-26840
This commit is contained in:
+9
-1
@@ -571,6 +571,10 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
}
|
||||
|
||||
public void addWatchedPrefix(int startOffset, ElementPattern<String> restartCondition) {
|
||||
int caret = myEditor.getCaretModel().getOffset();
|
||||
if (caret < startOffset) {
|
||||
LOG.error("caret=" + caret + "; start=" + startOffset);
|
||||
}
|
||||
myRestartingPrefixConditions.add(Pair.create(startOffset, restartCondition));
|
||||
}
|
||||
|
||||
@@ -578,7 +582,11 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
final CharSequence text = myEditor.getDocument().getCharsSequence();
|
||||
final int caretOffset = myEditor.getCaretModel().getOffset();
|
||||
for (Pair<Integer, ElementPattern<String>> pair : myRestartingPrefixConditions) {
|
||||
final String newPrefix = text.subSequence(pair.first, caretOffset).toString();
|
||||
int start = pair.first;
|
||||
if (caretOffset < start) {
|
||||
LOG.error("caret=" + caretOffset + "; start=" + start);
|
||||
}
|
||||
final String newPrefix = text.subSequence(start, caretOffset).toString();
|
||||
if (pair.second.accepts(newPrefix)) {
|
||||
scheduleRestart();
|
||||
myRestartingPrefixConditions.clear();
|
||||
|
||||
Reference in New Issue
Block a user