From 284be749278a7b6471926a618877dbb3adc8c1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Sat, 16 Aug 2014 19:24:34 +0200 Subject: Count number of marked files --- main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.c') 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(); } -- cgit v1.2.3