Krolyxon
Commit 004fcd5

Branches

Refs →

nsxiv004fcd5

Left bar shows file name as given by user

Author
Bert Münnich
Date
2017-12-07 14:08 +0100
Parent
eb96c71
Commit
004fcd5c5b0bbd74b643fc1959102a274593d257

+6 −20

2 files changed

  1. M Makefile +1 −1
  2. M main.c +5 −19
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20171123
1+VERSION = git-20171207
22
33 srcdir = .
44 VPATH = $(srcdir)
M main.c View
@@ -340,7 +340,6 @@ void update_info(void)
340340 unsigned int i, fn, fw;
341341 char title[256];
342342 const char * mark;
343− bool ow_info;
344343 win_bar_t *l = &win.bar.l, *r = &win.bar.r;
345344
346345 /* update window title */
@@ -359,15 +358,12 @@ void update_info(void)
359358 l->p = l->buf;
360359 r->p = r->buf;
361360 if (mode == MODE_THUMB) {
362− if (tns.loadnext < tns.end) {
361+ if (tns.loadnext < tns.end)
363362 bar_put(l, "Loading... %0*d", fw, tns.loadnext + 1);
364− ow_info = false;
365− } else if (tns.initnext < filecnt) {
363+ else if (tns.initnext < filecnt)
366364 bar_put(l, "Caching... %0*d", fw, tns.initnext + 1);
367− ow_info = false;
368− } else {
369− ow_info = true;
370− }
365+ else
366+ strncpy(l->buf, files[fileidx].name, l->size);
371367 bar_put(r, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt);
372368 } else {
373369 bar_put(r, "%s", mark);
@@ -385,18 +381,8 @@ void update_info(void)
385381 bar_put(r, "%0*d/%d | ", fn, img.multi.sel + 1, img.multi.cnt);
386382 }
387383 bar_put(r, "%0*d/%d", fw, fileidx + 1, filecnt);
388− ow_info = info.f.err != 0;
389− }
390− if (ow_info) {
391− fn = strlen(files[fileidx].name);
392− if (fn < l->size &&
393− win_textwidth(&win.env, files[fileidx].name, fn, true, NULL) +
394− win_textwidth(&win.env, r->buf, r->p - r->buf, true, NULL) < win.w)
395− {
384+ if (info.f.err)
396385 strncpy(l->buf, files[fileidx].name, l->size);
397− } else {
398− strncpy(l->buf, files[fileidx].base, l->size);
399− }
400386 }
401387 }
402388