tAdd missing code - ve - a minimal text editor (work in progress)
(HTM) git clone git://src.adamsgaard.dk/ve
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 18ab23e370638b99bc93e211bbc9ae65686e08c7
(DIR) parent 27dc307eae9e93c25bc9bba5fa30e92fc2eba879
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
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(-)
---
(DIR) 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++;
+}
(DIR) 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