/** * Auto-completes a string at the specified position. * * @param string string * @param start start position */ private void complete(final String string, final int start) { final int caret = editor.pos(); editor.complete(string, start); hist.store(editor.text(), caret, editor.pos()); scrollCode.invokeLater(true); }