ded

Dramatic EDitor
Index Commits Files Refs README LICENSE
commit f62bf8c5814648e97aa8e1b08e6da193c836e516
parent 58736a6630e5d5641df71ce3321df9389b4ca835
Author: rexim <reximkut@gmail.com>
Date:   Thu, 12 Jan 2023 23:19:26 +0700

Reset the cursor every time we open a new file

Diffstat:
Msrc/editor.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/editor.c b/src/editor.c
@@ -57,6 +57,8 @@ Errno editor_load_from_file(Editor *e, const char *file_path)
     Errno err = read_entire_file(file_path, &e->data);
     if (err != 0) return err;
 
+    e->cursor = 0;
+
     editor_recompute_lines(e);
 
     e->file_path.count = 0;