Просмотр исходного кода

Reset the cursor every time we open a new file

rexim 2 лет назад
Родитель
Сommit
f62bf8c581
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      src/editor.c

+ 2 - 0
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;