aboutsummaryrefslogtreecommitdiff
path: root/src/line
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-09 07:43:29 +0000
committer_ov4 <ov4@ov4.org>2026-10-09 07:43:29 +0000
commit7317365cb26d1cfbecf42b67b5c320f0f610bf42 (patch)
tree2a2f64eda7ff0c9f4c0d70e372cad39dda47d21b /src/line
parentca262bfccff86c44d4f0cab467e4b7a3a70fe353 (diff)
add bell for buffer edge
Diffstat (limited to 'src/line')
-rw-r--r--src/line/cursor.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/line/cursor.cc b/src/line/cursor.cc
index faa3988..9c0bf28 100644
--- a/src/line/cursor.cc
+++ b/src/line/cursor.cc
@@ -109,7 +109,11 @@ void move_cursor(T_cursor_movement_direction d)
else
{
// already at the beginning of buffer
- if (buffer_index_cursor == 0) break;
+ if (buffer_index_cursor == 0)
+ {
+ print("\a"); fflush(stdout);
+ break;
+ }
buffer_index_cursor--;
_buffer_index_display_begin--;
@@ -122,7 +126,11 @@ void move_cursor(T_cursor_movement_direction d)
if (window_size_col > get_terminal_pos_cursor())
{
// already at the end of buffer
- if (buffer_index_cursor == line_buffer.size()) break;
+ if (buffer_index_cursor == line_buffer.size())
+ {
+ print("\a"); fflush(stdout);
+ break;
+ }
buffer_index_cursor++;
print("\x1b[C"); fflush(stdout); // move cursor to the right
@@ -131,7 +139,11 @@ void move_cursor(T_cursor_movement_direction d)
else
{
// already at the end of buffer
- if (buffer_index_cursor == line_buffer.size()) break;
+ if (buffer_index_cursor == line_buffer.size())
+ {
+ print("\a"); fflush(stdout);
+ break;
+ }
buffer_index_cursor++;
_buffer_index_display_begin++;