diff options
author | Bert Münnich <ber.t@posteo.de> | 2014-08-16 19:24:34 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2014-08-16 21:49:46 +0200 |
commit | 284be749278a7b6471926a618877dbb3adc8c1ad (patch) | |
tree | 59948c446a156c50a28340ae9c968cec91a9f939 /main.c | |
parent | 5b01c15176298b0335432e089d70e55c84379756 (diff) | |
download | nsxiv-284be749278a7b6471926a618877dbb3adc8c1ad.tar.zst |
Count number of marked files
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -73,6 +73,7 @@ win_t win; fileinfo_t *files; int filecnt, fileidx; int alternate; +int markcnt; int prefix; bool extprefix; @@ -168,6 +169,8 @@ void remove_file(int n, bool manual) cleanup(); exit(manual ? EXIT_SUCCESS : EXIT_FAILURE); } + if (files[n].marked) + markcnt--; if (files[n].path != files[n].name) free((void*) files[n].path); @@ -627,6 +630,7 @@ void on_buttonpress(XButtonEvent *bev) case Button3: if ((sel = tns_translate(&tns, bev->x, bev->y)) >= 0) { files[sel].marked = !files[sel].marked; + markcnt += files[sel].marked ? 1 : -1; tns_mark(&tns, sel, files[sel].marked); redraw(); } |