This commit is contained in:
SowinskiBraeden committed 2022-09-07 10:55:10 -07:00
1 parent 8f3459b18b
commit 585129d860
1 file changed
+9
+9
View File
@@ -289,6 +289,15 @@ void editorRowDelChar(erow* row, int at) {
E.dirty++; E.dirty++;
} }
void editorRowInsert(erow *row, int at, int c) {
if (at < 0 || at >= row->size) at = row->size;
row->chars = (char*)realloc(row->chars, row->size + 2);
memmove(&row->chars[at + 1], &row->chars[at], row->size - at + 1);
row->size++;
row->chars[at] = c;
editorUpdateRow(row);
}
/*** editor operations ***/ /*** editor operations ***/
void editorInsertChar(int c) { void editorInsertChar(int c) {