creating new lines works now, fixed several segfaults and bugs
This commit is contained in:
+2
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user