aceEditor.addAceChangedListener(e -> {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(e.getValue().getBytes(Charset.forName("utf8"))), Charset.forName("utf8")));
String line;
pos = aceEditor.getCursorPosition();
Notification.show("pos="+pos[0]
+","+pos[1]
);
int l = 0;
while ((line = br.readLine()) != null) {
if (l == pos[0]
) {
if (line.substring(pos[1]
-1,pos[1]
).equals(".")){
String[] ac = {"test","complete"};
aceEditor.setCustomAutoCompletion(ac);
Notification.show(line.substring(pos[1]
-1,pos[1]
));
}
break;
}
l++;
}
} catch (Exception ex) {
}
});
aceEditor.getCursorPosition() always return (0,0) or previous postion, why?