/* should we set the SELECTED bit? */
if (selected) {
set_selected(mp, msgnum);
-
- /* check if highest or lowest selected */
- if (mp->numsel == 0) {
- mp->lowsel = msgnum;
- mp->hghsel = msgnum;
- } else {
- if (msgnum < mp->lowsel)
- mp->lowsel = msgnum;
- if (msgnum > mp->hghsel)
- mp->hghsel = msgnum;
- }
-
- /* increment number selected */
- mp->numsel++;
}
/*
/* unselect message */
unset_selected(mp, msgnum);
- mp->numsel--;
snprintf(msgpath, sizeof (msgpath), "%s/%d",
mp->foldpath, msgnum);
return; /* dont select twice */
}
set_selected(mp, msg);
- mp->numsel++;
- if (mp->lowsel == 0 || msg < mp->lowsel) {
- mp->lowsel = msg;
- }
- if (msg > mp->hghsel) {
- mp->hghsel = msg;
- }
}
int
{
assert_msg_range(mp, msgnum);
mp->msgstats[msgnum - mp->lowoff] |= SELECTED;
+ if (mp->lowsel == 0 || msgnum < mp->lowsel) {
+ mp->lowsel = msgnum;
+ }
+ if (msgnum > mp->hghsel) {
+ mp->hghsel = msgnum;
+ }
+ mp->numsel++;
}
void
{
assert_msg_range(mp, msgnum);
mp->msgstats[msgnum - mp->lowoff] &= ~SELECTED;
+ if (mp->numsel > 0) {
+ mp->numsel--;
+ }
}
void
} else {
/* if it doesn't match, then unselect it */
unset_selected(mp, msgnum);
- mp->numsel--;
}
if (fp)
fclose(fp);