summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-08-16 19:24:34 +0200
committerBert Münnich <ber.t@posteo.de>2014-08-16 21:49:46 +0200
commit284be749278a7b6471926a618877dbb3adc8c1ad (patch)
tree59948c446a156c50a28340ae9c968cec91a9f939 /main.c
parent5b01c15176298b0335432e089d70e55c84379756 (diff)
downloadnsxiv-284be749278a7b6471926a618877dbb3adc8c1ad.tar.zst
Count number of marked files
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 48eca54..10d15ab 100644
--- a/main.c
+++ b/main.c
@@ -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();
}