Got backspace + autocomplete (CTRL SPACE) working, now functions when cursor mid sentence/word

This commit is contained in:
bigguy345 committed 2026-01-04 02:22:23 +02:00
1 parent 9886dae519
commit 02ce0912c7
1 file changed
+8
@@ -608,12 +608,20 @@ public class AutocompleteManager {
private int findDotBeforeWhitespace(String text, int fromPos) {
int pos = fromPos;
// Skip backwards over whitespace
while (pos >= 0 && Character.isWhitespace(text.charAt(pos))) {
pos--;
}
// Check if we found a dot
if (pos >= 0 && text.charAt(pos) == '.') {
return pos;
} else {
while (pos >= 0 && Character.isJavaIdentifierPart(text.charAt(pos)))
pos--;
if (pos >= 0 && text.charAt(pos) == '.')
return pos;
}
return -1;
}