private void updateAutoCompleteOptions() {
		String txtArea = getAllText();
		if ((getCaretLocation() - 1 >= 0) && (cmdStartPos < getCaretLocation())
				&& (getCaretLocation() <= txtArea.length())) {
			if (getAllText().charAt(getCaretLocation() - 1) == '\\') {
				cmdStartPos = getCaretLocation() - 1;
			}
			if (cmdStartPos >= 0) {// && ((getCaretLocation()-cmdStartPos)>1)
				String txtOpts[] = autoComp.getBestGuess(txtArea.substring(
						cmdStartPos, getCaretLocation() + 1));
				((LatexMaker) frame).setAutoCompleteOptions(txtOpts);
				if (txtOpts[0] == "") {
					cmdStartPos = -1;
				}
			}
		}
	}