diff options
Diffstat (limited to 'src/line/cursor.cc')
| -rw-r--r-- | src/line/cursor.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/line/cursor.cc b/src/line/cursor.cc index b44054e..4b51d04 100644 --- a/src/line/cursor.cc +++ b/src/line/cursor.cc @@ -123,7 +123,7 @@ void move_cursor(T_cursor_movement_direction d) { case T_cursor_movement_direction::LEFT: // if cursor is not at left margin - if (prompt_pos < get_terminal_pos_cursor()) + if (prompt_pos+1 < get_terminal_pos_cursor()) { buffer_index_cursor--; print("\x1b[D"); fflush(stdout); // move cursor to the left @@ -144,7 +144,7 @@ void move_cursor(T_cursor_movement_direction d) { // already at the end of buffer if (buffer_index_cursor == line_buffer.size()) break; - + buffer_index_cursor++; print("\x1b[C"); fflush(stdout); // move cursor to the right } |
