mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Add option to suppress blank lines between reminders in Calendar Mode.
This commit is contained in:
@@ -1525,11 +1525,14 @@ static int WriteOneColLine(int col)
|
||||
int clamp = 1;
|
||||
int numwritten = 0;
|
||||
int d = ColToDay[col];
|
||||
char const *url = get_url(e->infos);
|
||||
char const *url;
|
||||
|
||||
if (d && UseBGVTColors && bgcolor[d][0] != -1) {
|
||||
clamp = 0;
|
||||
}
|
||||
PRINTROW:
|
||||
url = get_url(e->infos);
|
||||
|
||||
/* Print as many characters as possible within the column */
|
||||
if (e->wc_text) {
|
||||
wspace = NULL;
|
||||
@@ -1538,14 +1541,21 @@ static int WriteOneColLine(int col)
|
||||
/* If we're at the end, and there's another entry, do a blank
|
||||
line and move to next entry. */
|
||||
if (!*ws && e->next) {
|
||||
PrintLeft("", ColSpaces, ' ');
|
||||
if (CalSepLine) {
|
||||
PrintLeft("", ColSpaces, ' ');
|
||||
}
|
||||
CalColumn[col] = e->next;
|
||||
free(e->text);
|
||||
free(e->raw_text);
|
||||
if (e->wc_text) free(e->wc_text);
|
||||
FreeTrigInfoChain(e->infos);
|
||||
free(e);
|
||||
return 1;
|
||||
if (!CalSepLine) {
|
||||
e = CalColumn[col];
|
||||
goto PRINTROW;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the last space char within the column. */
|
||||
@@ -1648,14 +1658,22 @@ static int WriteOneColLine(int col)
|
||||
/* If we're at the end, and there's another entry, do a blank
|
||||
line and move to next entry. */
|
||||
if (!*s && e->next) {
|
||||
PrintLeft("", ColSpaces, ' ');
|
||||
if (CalSepLine) {
|
||||
PrintLeft("", ColSpaces, ' ');
|
||||
}
|
||||
CalColumn[col] = e->next;
|
||||
free(e->text);
|
||||
if (e->wc_text) free(e->wc_text);
|
||||
free(e->raw_text);
|
||||
FreeTrigInfoChain(e->infos);
|
||||
free(e);
|
||||
return 1;
|
||||
if (!CalSepLine) {
|
||||
e = CalColumn[col];
|
||||
fprintf(stderr, "BLOOP\n");
|
||||
goto PRINTROW;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the last space char within the column. */
|
||||
|
||||
@@ -146,6 +146,7 @@ EXTERN int ArgC;
|
||||
EXTERN char const **ArgV;
|
||||
EXTERN INIT( int CalLines, CAL_LINES);
|
||||
EXTERN INIT( int CalPad, 1);
|
||||
EXTERN INIT( int CalSepLine, 1);
|
||||
EXTERN INIT( int UseVTChars, 0);
|
||||
EXTERN INIT( int UseBGVTColors, 0);
|
||||
EXTERN INIT( int UseUTF8Chars, 0);
|
||||
|
||||
13
src/init.c
13
src/init.c
@@ -644,8 +644,17 @@ void InitRemind(int argc, char const *argv[])
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
PARSENUM(CalPad, arg);
|
||||
if (CalPad > 20) CalPad = 20;
|
||||
if (*arg != ',') {
|
||||
PARSENUM(CalPad, arg);
|
||||
if (CalPad > 20) CalPad = 20;
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
PARSENUM(CalSepLine, arg);
|
||||
if (CalSepLine) {
|
||||
CalSepLine = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user