!7 sclass SFAutoComplete > DynObjectTable { transient WeakReference tc; start { doEveryAndNow(2000, r { if (!isVisible()) ret; JTextComponent c = optCast(JTextComponent, getFocusOwner()); if (c == null) ret; tc = weakRef(c); int i = getCaretPosition(c); S word = lastWord(takeFirst(getText(c), i)); setData(takeFirst(10, prefixSubSet(standardFunctionNames_sorted(), word)); }); } void onDoubleClick(S s) { JTextComponent c = getWeakRef(tc); if (c != null) { int i = getCaretPosition(c); Document doc = c.getDocument(); S word = lastWord(takeFirst(getText(c), i)); doc.insertString(i, dropPrefix(word, s), null); } } }