CE edit status line
This commit is contained in:
12
ce/edit.c
12
ce/edit.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user