# HG changeset patch # User Torsten Lilge # Date 1654876941 -7200 # Node ID d5696a4efa848adcf9aeae0181a0bbaef5caa1ee # Parent 037c1e768b56becd5a815fdb27dbe90bbff070b3 exp cmd widget: fix preventing prompt deletion * command-widget.cc (cursor_position_changed): store current position in correct variable, add last char of prompt if deleted this by backspace diff -r 037c1e768b56 -r d5696a4efa84 libgui/src/command-widget.cc --- a/libgui/src/command-widget.cc Thu Jun 09 09:00:17 2022 -0400 +++ b/libgui/src/command-widget.cc Fri Jun 10 18:02:21 2022 +0200 @@ -249,14 +249,17 @@ // Cursor position changed: Are we in the command line or not? void console::cursor_position_changed (int line, int col) { - m_command_position = positionFromLineIndex (line, col); + m_cursor_position = positionFromLineIndex (line, col); if (m_cursor_position < m_command_position) { // We are in the read only area if (m_text_changed && (m_cursor_position == m_command_position - 1)) - undo (); // And here we have tried to remove the prompt by Backspace - else - setReadOnly (true); + { + setReadOnly (false); + insert (m_command_widget->prompt ().right (1)); // And here we have tried to remove the prompt by Backspace + setCursorPosition (line+1, col); + } + setReadOnly (true); } else setReadOnly (false); // Writable area