From c2336a8a22a5ddf26b33a53f914bf0d5397a6553 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 22 Sep 2026 02:52:22 +0000 Subject: add cursor moving limit pos --- include/line/cursor.h | 28 ++++++++++++++++++++++++++++ include/line/mode.h | 12 ------------ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 include/line/cursor.h (limited to 'include') diff --git a/include/line/cursor.h b/include/line/cursor.h new file mode 100644 index 0000000..7417201 --- /dev/null +++ b/include/line/cursor.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +using namespace std; // TODO: remove + +namespace ov4 +{ + +struct T_position +{ + int row; + int col; +}; + +inline int cursor_row; +inline int cursor_col; + +inline int line_end_pos; + +T_position get_cursor_position(); + +void print_override(const std::string &s); + +void move_cursor(char c); + +} + diff --git a/include/line/mode.h b/include/line/mode.h index c0c8ace..85836c7 100644 --- a/include/line/mode.h +++ b/include/line/mode.h @@ -8,15 +8,7 @@ using namespace std; // TODO: remove namespace ov4 { -struct T_position -{ - int row; - int col; -}; - inline termios attr; -inline int cursor_row; -inline int cursor_col; void disable_raw(); void enable_raw(); @@ -25,8 +17,4 @@ void clear_below(); std::string readline(); -T_position get_cursor_position(); - -void print_override(const std::string &s); - } -- cgit v1.3.1-4-g156e