aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-09-22 02:52:22 +0000
committer_ov4 <ov4@ov4.org>2026-09-22 02:52:22 +0000
commitc2336a8a22a5ddf26b33a53f914bf0d5397a6553 (patch)
tree9ef3dbe23ab28ed000acfaadd2c46e15e0f09abc /include
parent74e96589df2a77735410c5c03454a195d7efeecb (diff)
add cursor moving limit pos
Diffstat (limited to 'include')
-rw-r--r--include/line/cursor.h28
-rw-r--r--include/line/mode.h12
2 files changed, 28 insertions, 12 deletions
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 <string>
+
+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);
-
}