aboutsummaryrefslogtreecommitdiff
path: root/src/line/cursor.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-08 15:08:00 +0000
committer_ov4 <ov4@ov4.org>2026-10-08 15:08:00 +0000
commit0e9bbb3d8922405585304b220cbbf8b28cfa7978 (patch)
treec465a83f5f524f66ea86ab9faf912f16299af3c7 /src/line/cursor.cc
parent6864b943fb91debe90b88e2e8a3a063fa89cbdce (diff)
fix get_terminal_pos_cursor
Diffstat (limited to 'src/line/cursor.cc')
-rw-r--r--src/line/cursor.cc4
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
}