shithub: orca

Download patch

ref: 070d9a990d8249ae105f838f4ab03427aefd2e9b
parent: 255184b40bc9f0b413663ac170f447b541f33128
author: cancel <cancel@cancel.fm>
date: Fri Dec 7 18:22:33 EST 2018

Fix filename display

--- a/tui_main.c
+++ b/tui_main.c
@@ -470,6 +470,7 @@
   Tui_input_mode input_mode;
   Usz bpm;
   double accum_secs;
+  char const* filename;
   bool needs_remarking;
   bool is_draw_dirty;
   bool is_playing;
@@ -492,6 +493,7 @@
   a->input_mode = Tui_input_mode_normal;
   a->bpm = 120;
   a->accum_secs = 0.0;
+  a->filename = NULL;
   a->needs_remarking = true;
   a->is_draw_dirty = false;
   a->is_playing = false;
@@ -588,7 +590,8 @@
                    a->tui_cursor.y, a->tui_cursor.x, a->input_mode,
                    a->is_playing);
   if (win_h > 3) {
-    tdraw_hud(win, win_h - 2, 0, 2, win_w, "noname", a->field.height,
+    char const* filename = a->filename ? a->filename : "";
+    tdraw_hud(win, win_h - 2, 0, 2, win_w, filename, a->field.height,
               a->field.width, a->ruler_spacing_y, a->ruler_spacing_x,
               a->tick_num, a->bpm, &a->tui_cursor, a->input_mode);
   }
@@ -820,6 +823,8 @@
     input_file = "unnamed";
     field_init_fill(&app_state.field, 25, 57, '.');
   }
+  app_state.filename = input_file;
+
   // Set up timer lib
   stm_setup();