Skip to content

isAutoActivateOkay() checks wrong character #77

Description

@DevCharly

isAutoActivateOkay() checks the character after the caret, but shouldn't it check the character before the caret?

public boolean isAutoActivateOkay(JTextComponent tc) {
Document doc = tc.getDocument();
char ch = 0;
try {
doc.getText(tc.getCaretPosition(), 1, s);
ch = s.first();
} catch (BadLocationException ble) { // Never happens
ble.printStackTrace();
}
return (autoActivateAfterLetters && Character.isLetter(ch)) ||
(autoActivateChars!=null && autoActivateChars.indexOf(ch)>-1);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions