CE edit status line

This commit is contained in:
2026-03-05 19:58:16 +01:00
parent 6f392d0a32
commit abc7ac39c1
4 changed files with 14 additions and 4 deletions

View File

@@ -77,9 +77,10 @@ static void update_vert_scroll (size_t screen_rows) {
editor.row_offset = editor.cursor.line - (screen_rows - 1) + 1;
}
void edit_start (const char* text) {
void edit_start (const char* file_path, const char* text) {
prepare_lines (text);
struct arena temp_arena;
memset (&temp_arena, 0, sizeof (temp_arena));
size_t cols, rows;
terminal_dimensions (&cols, &rows);
@@ -145,6 +146,15 @@ void edit_start (const char* text) {
current_idx++;
}
w = snprintf (bbptr, bb_remaining, ANSIQ_DYN_CUR_SET ANSIQ_SCR_CLR_LINE, (int)rows, 1);
bbptr += w;
bb_remaining -= w;
w = snprintf (bbptr, bb_remaining, "Editing %s; line %zu col %zu", file_path,
editor.cursor.line, editor.cursor.col);
bbptr += w;
bb_remaining -= w;
w = snprintf (bbptr, bb_remaining, ANSIQ_DYN_CUR_SET ANSIQ_CUR_VISIBLE,
(int)(editor.cursor.line - editor.row_offset) + 1,
(int)(editor.cursor.col - editor.col_offset) + 1);

View File

@@ -1,6 +1,6 @@
#ifndef _EDIT_H
#define _EDIT_H
void edit_start (const char* text);
void edit_start (const char* path, const char* text);
#endif // _EDIT_H

View File

@@ -235,7 +235,7 @@ static void edit (struct context* context, const char* path_string) {
return;
}
edit_start (str);
edit_start (path_string, str);
volume_close ();
}