if (historyIndex > 0) {
                        historyIndex -= 1;
                        text = history.get(historyIndex);
                        System.out.println(text);
                        cursorX = text.length();