File src/hstr.c changed (mode: 100644) (index 9bcaeab..cd0ccc1) |
66 |
66 |
|
|
67 |
67 |
#define HH_ENV_VAR_CONFIG "HH_CONFIG" |
#define HH_ENV_VAR_CONFIG "HH_CONFIG" |
68 |
68 |
|
|
69 |
|
// TODO make hicolor default, introduce monochromatic |
|
70 |
69 |
#define HH_CONFIG_MONO "monochromatic" |
#define HH_CONFIG_MONO "monochromatic" |
71 |
70 |
#define HH_CONFIG_HICOLOR "hicolor" |
#define HH_CONFIG_HICOLOR "hicolor" |
72 |
71 |
#define HH_CONFIG_CASE "casesensitive" |
#define HH_CONFIG_CASE "casesensitive" |
|
... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
519 |
518 |
clrtobot(); |
clrtobot(); |
520 |
519 |
|
|
521 |
520 |
int start, end; |
int start, end; |
522 |
|
char buffer[CMDLINE_LNG]; |
|
|
521 |
|
char screenLine[CMDLINE_LNG]; |
523 |
522 |
for (i = 0; i<height; ++i) { |
for (i = 0; i<height; ++i) { |
524 |
523 |
if(i<hstr->selectionSize) { |
if(i<hstr->selectionSize) { |
525 |
524 |
// TODO make this function |
// TODO make this function |
|
... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
527 |
526 |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
528 |
527 |
start=hstr->selectionRegexpMatch[i].rm_so; |
start=hstr->selectionRegexpMatch[i].rm_so; |
529 |
528 |
end=hstr->selectionRegexpMatch[i].rm_eo-start; |
end=hstr->selectionRegexpMatch[i].rm_eo-start; |
530 |
|
strncpy(buffer, |
|
|
529 |
|
strncpy(screenLine, |
531 |
530 |
hstr->selection[i]+start, |
hstr->selection[i]+start, |
532 |
531 |
end); |
end); |
533 |
|
buffer[end]=0; |
|
|
532 |
|
screenLine[end]=0; |
534 |
533 |
} else { |
} else { |
535 |
|
strcpy(buffer, pattern); |
|
|
534 |
|
strcpy(screenLine, pattern); |
536 |
535 |
} |
} |
537 |
|
print_selection_row(hstr->selection[i], y++, width, buffer); |
|
|
536 |
|
print_selection_row(hstr->selection[i], y++, width, screenLine); |
538 |
537 |
} else { |
} else { |
539 |
538 |
print_selection_row(hstr->selection[i], y++, width, pattern); |
print_selection_row(hstr->selection[i], y++, width, pattern); |
540 |
539 |
} |
} |