| File src/ui/fileview.c changed (mode: 100644) (index c88d33731..6c941d322) |
| ... |
... |
static void column_line_print(const char buf[], int offset, AlignType align, |
| 123 |
123 |
static void column_line_match(const char full_column[], |
static void column_line_match(const char full_column[], |
| 124 |
124 |
const format_info_t *info, int *match_from, int *match_to); |
const format_info_t *info, int *match_from, int *match_to); |
| 125 |
125 |
static void draw_line_number(const column_data_t *cdt, int column); |
static void draw_line_number(const column_data_t *cdt, int column); |
| 126 |
|
static int is_primary_colored_column_id(int id); |
|
| 127 |
126 |
static int is_primary_column_id(int id); |
static int is_primary_column_id(int id); |
| 128 |
127 |
static cchar_t prepare_col_color(const view_t *view, int is_primary_colored, |
static cchar_t prepare_col_color(const view_t *view, int is_primary_colored, |
| 129 |
128 |
int line_nr, const column_data_t *cdt, int real_id, int filling); |
int line_nr, const column_data_t *cdt, int real_id, int filling); |
| |
| ... |
... |
column_line_print(const char buf[], int offset, AlignType align, |
| 1184 |
1183 |
const int padding = (cfg.extra_padding != 0); |
const int padding = (cfg.extra_padding != 0); |
| 1185 |
1184 |
const int filling = (info->id == FILL_COLUMN_ID); |
const int filling = (info->id == FILL_COLUMN_ID); |
| 1186 |
1185 |
|
|
| 1187 |
|
const int is_primary_colored = is_primary_colored_column_id(info->id); |
|
|
1186 |
|
const int is_primary_column = is_primary_column_id(info->id); |
|
1187 |
|
/* Only primary columns can have tree pseudo-graphics. */ |
|
1188 |
|
const int is_treeable_column = is_primary_column; |
|
1189 |
|
/* Primary and extension columns are affected by highlighting derived from |
|
1190 |
|
* file's type, path or name. */ |
|
1191 |
|
const int is_primary_colored = info->id == SK_BY_EXTENSION |
|
1192 |
|
|| info->id == SK_BY_FILEEXT |
|
1193 |
|
|| is_primary_column; |
|
1194 |
|
|
| 1188 |
1195 |
const cchar_t line_attrs = |
const cchar_t line_attrs = |
| 1189 |
1196 |
prepare_col_color(view, is_primary_colored, 0, cdt, info->real_id, filling); |
prepare_col_color(view, is_primary_colored, 0, cdt, info->real_id, filling); |
| 1190 |
1197 |
|
|
| 1191 |
1198 |
/* Non-empty prefix contains tree pseudo-graphics. */ |
/* Non-empty prefix contains tree pseudo-graphics. */ |
| 1192 |
|
const int is_treeable_column = is_primary_column_id(info->id); |
|
| 1193 |
1199 |
size_t extra_prefix = is_treeable_column ? *cdt->prefix_len : 0U; |
size_t extra_prefix = is_treeable_column ? *cdt->prefix_len : 0U; |
| 1194 |
1200 |
|
|
| 1195 |
1201 |
if(extra_prefix != 0U && align == AT_RIGHT) |
if(extra_prefix != 0U && align == AT_RIGHT) |
| |
| ... |
... |
column_line_match(const char full_column[], const format_info_t *info, |
| 1345 |
1351 |
} |
} |
| 1346 |
1352 |
} |
} |
| 1347 |
1353 |
|
|
| 1348 |
|
/* Checks whether column id corresponds to a column that is affected by a |
|
| 1349 |
|
* highlight derived from file's type/path/name. Returns non-zero if so. */ |
|
| 1350 |
|
static int |
|
| 1351 |
|
is_primary_colored_column_id(int id) |
|
| 1352 |
|
{ |
|
| 1353 |
|
return id == SK_BY_EXTENSION |
|
| 1354 |
|
|| id == SK_BY_FILEEXT |
|
| 1355 |
|
|| is_primary_column_id(id); |
|
| 1356 |
|
} |
|
| 1357 |
|
|
|
| 1358 |
1354 |
/* Checks whether column id corresponds to a column that displays a substantial |
/* Checks whether column id corresponds to a column that displays a substantial |
| 1359 |
1355 |
* part of entry's path. Such columns can be searched and also display |
* part of entry's path. Such columns can be searched and also display |
| 1360 |
1356 |
* pseudographics of a tree. Returns non-zero if so. */ |
* pseudographics of a tree. Returns non-zero if so. */ |