creating new lines works now, fixed several segfaults and bugs

This commit is contained in:
FantasyPvP
2024-11-07 14:50:17 +00:00
parent 214dfc66a5
commit bef5547d50
6 changed files with 54 additions and 86 deletions
+2 -5
View File
@@ -22,11 +22,8 @@ int open_editor() {
int max_y, max_x;
getmaxyx(stdscr, max_y, max_x);
move(0, 0);
Editor editor = editor_from("this is some text to edit\nthis is the second line\nand this is the third lol");
fprintf(stderr, "%d %d %d %d", editor.lines, editor.screen_line, editor.screen_col, editor.editmode);
move(0, 5);
while (true) {
refresh();
@@ -37,8 +34,8 @@ int open_editor() {
editor.editmode = false;
break;
case KEY_BACKSPACE:
delchar(&editor);
move_cursor(&editor, -1, 0);
delchar(&editor);
break;
case KEY_DC:
delchar(&editor);