tAdd missing code - ve - a minimal text editor (work in progress) | |
git clone git://src.adamsgaard.dk/ve | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 18ab23e370638b99bc93e211bbc9ae65686e08c7 | |
parent 27dc307eae9e93c25bc9bba5fa30e92fc2eba879 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 6 Aug 2019 15:51:43 +0200 | |
Add missing code | |
Diffstat: | |
A edit.c | 11 +++++++++++ | |
A edit.h | 6 ++++++ | |
2 files changed, 17 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/edit.c b/edit.c | |
t@@ -0,0 +1,11 @@ | |
+#include "row.h" | |
+#include "byote.h" | |
+ | |
+void | |
+editor_insert_char(int c) | |
+{ | |
+ if (E.cursor_y == E.num_rows) | |
+ editor_append_row("", 0); | |
+ editor_row_insert_char(&E.row[E.cursor_y], E.cursor_x, c); | |
+ E.cursor_x++; | |
+} | |
diff --git a/edit.h b/edit.h | |
t@@ -0,0 +1,6 @@ | |
+#ifndef EDIT_H_ | |
+#define EDIT_H_ | |
+ | |
+void editor_insert_char(int c); | |
+ | |
+#endif |