From f53fd66d8808917c9397adb07f7379a863ec2516 Mon Sep 17 00:00:00 2001 From: nova Date: Wed, 4 Feb 2026 22:20:00 +0100 Subject: [PATCH] added printing of mid_content[selected_file_current].file_name in top ui --- threading.c | 1 + window.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/threading.c b/threading.c index 6788e4e..41ff626 100644 --- a/threading.c +++ b/threading.c @@ -246,6 +246,7 @@ void *thread_top(){ top_buffer = malloc(strlen(global_path)+1); memcpy(top_buffer, global_path, strlen(global_path)+1); top_width = strlen(top_buffer); + /*printing of mid_content[selected_file_current].file_name is done directly in window.c window_top()*/ pthread_mutex_unlock(&mutex_top); } diff --git a/window.c b/window.c index e328a4d..3219c2d 100644 --- a/window.c +++ b/window.c @@ -37,11 +37,13 @@ void window_top(WINDOW *win){ werase(win); if (pthread_mutex_trylock(&mutex_top) == 0) { - wattron(win, COLOR_PAIR(COLOR_PATH)); if (*top_buffer != ' ') { /*printing ' ' (standard initialized value, see threading_init) makes valgrind throw a fuss*/ + wattron(win, COLOR_PAIR(COLOR_PATH)); mvwaddstr(win, 0, 0, top_buffer); + mvwaddch(win, 0, strlen(top_buffer), '/'); + wattroff(win, COLOR_PAIR(COLOR_PATH)); + mvwaddstr(win, 0, strlen(top_buffer)+1, mid_content[selected_file_current].file_name); } - wattroff(win, COLOR_PAIR(COLOR_PATH)); pthread_mutex_unlock(&mutex_top); } else { mvwaddstr(win, 0, terminal_width/2, "LOADING");