if (historyIndex < history.size() - 1) {
                        historyIndex += 1;
                        text = history.get(historyIndex);
                        System.out.println(text);
                        cursorX = text.length();