diff options
author | Bert Münnich <ber.t@posteo.de> | 2017-12-07 14:08:37 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2017-12-07 14:08:37 +0100 |
commit | 004fcd5c5b0bbd74b643fc1959102a274593d257 (patch) | |
tree | acf387ee980394ff973857906c13901836a45ac4 | |
parent | eb96c7172555f96b07969c6abf74740bb03e36f9 (diff) |
Left bar shows file name as given by user
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | main.c | 24 |
2 files changed, 6 insertions, 20 deletions
@@ -1,4 +1,4 @@ -VERSION = git-20171123 +VERSION = git-20171207 srcdir = . VPATH = $(srcdir) @@ -340,7 +340,6 @@ void update_info(void) unsigned int i, fn, fw; char title[256]; const char * mark; - bool ow_info; win_bar_t *l = &win.bar.l, *r = &win.bar.r; /* update window title */ @@ -359,15 +358,12 @@ void update_info(void) l->p = l->buf; r->p = r->buf; if (mode == MODE_THUMB) { - if (tns.loadnext < tns.end) { + if (tns.loadnext < tns.end) bar_put(l, "Loading... %0*d", fw, tns.loadnext + 1); - ow_info = false; - } else if (tns.initnext < filecnt) { + else if (tns.initnext < filecnt) bar_put(l, "Caching... %0*d", fw, tns.initnext + 1); - ow_info = false; - } else { - ow_info = true; - } + else + strncpy(l->buf, files[fileidx].name, l->size); bar_put(r, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt); } else { bar_put(r, "%s", mark); @@ -385,18 +381,8 @@ void update_info(void) bar_put(r, "%0*d/%d | ", fn, img.multi.sel + 1, img.multi.cnt); } bar_put(r, "%0*d/%d", fw, fileidx + 1, filecnt); - ow_info = info.f.err != 0; - } - if (ow_info) { - fn = strlen(files[fileidx].name); - if (fn < l->size && - win_textwidth(&win.env, files[fileidx].name, fn, true, NULL) + - win_textwidth(&win.env, r->buf, r->p - r->buf, true, NULL) < win.w) - { + if (info.f.err) strncpy(l->buf, files[fileidx].name, l->size); - } else { - strncpy(l->buf, files[fileidx].base, l->size); - } } } |