Modified print_fixed_width to add some whitespace

This commit is contained in:
xavi 2024-09-15 11:05:41 -07:00
parent f3be9dc13c
commit de35e45daf
2 changed files with 4 additions and 3 deletions

View File

@ -210,7 +210,7 @@ int get_num_rows(sqlite3 *db, char* table, char* status){
// Print with FIXED_WIDTH
int print_fixed_width(const unsigned char* str, int width){
if (str){
printf("%-*.*s", width, width, str);
printf("%-*.*s", width, width - FIXED_WHITESPACE, str);
}else{
printf("%-*.*s", width, width, "");
}

View File

@ -4,10 +4,11 @@
#define SQLQUERY_MAX 100
#define ARG_MAX 100
#define NUM_TASK_LISTS 3
#define FIXED_TITLE_WIDTH 19
#define FIXED_DATE_WIDTH 14
#define FIXED_TITLE_WIDTH 21
#define FIXED_DATE_WIDTH 12
#define FIXED_ID_WIDTH 4
#define FIXED_COLUMN_WIDTH (FIXED_ID_WIDTH + FIXED_TITLE_WIDTH +FIXED_DATE_WIDTH)
#define FIXED_WHITESPACE 2
#define FIXED_MAX_WIDTH (FIXED_COLUMN_WIDTH)
#define TODAY_COL_START -1
#define BACKLOG_COL_START (FIXED_COLUMN_WIDTH + 1)