File src/hstr.c changed (mode: 100644) (index 54be6d9..1ac7a06) |
66 |
66 |
#define HH_COLOR_INFO 2 |
#define HH_COLOR_INFO 2 |
67 |
67 |
#define HH_COLOR_PROMPT 3 |
#define HH_COLOR_PROMPT 3 |
68 |
68 |
#define HH_COLOR_DELETE 4 |
#define HH_COLOR_DELETE 4 |
|
69 |
|
#define HH_COLOR_MATCH 5 |
69 |
70 |
|
|
70 |
71 |
#define HH_ENV_VAR_CONFIG "HH_CONFIG" |
#define HH_ENV_VAR_CONFIG "HH_CONFIG" |
71 |
72 |
|
|
|
... |
... |
void print_selection_row(char *text, int y, int width, char *pattern) |
559 |
560 |
|
|
560 |
561 |
if(pattern && strlen(pattern)) { |
if(pattern && strlen(pattern)) { |
561 |
562 |
color_attr_on(A_BOLD); |
color_attr_on(A_BOLD); |
|
563 |
|
color_attr_on(COLOR_PAIR(HH_COLOR_MATCH)); |
562 |
564 |
char *p; |
char *p; |
563 |
|
bool keywordsAllMatch; |
|
564 |
565 |
char *keywordsSavePtr; |
char *keywordsSavePtr; |
565 |
566 |
char *keywordsToken; |
char *keywordsToken; |
566 |
567 |
char *keywordsParsedLine; |
char *keywordsParsedLine; |
|
... |
... |
void print_selection_row(char *text, int y, int width, char *pattern) |
585 |
586 |
mvprintw(y, 1+(p-text), "%s", pattern); |
mvprintw(y, 1+(p-text), "%s", pattern); |
586 |
587 |
break; |
break; |
587 |
588 |
case HH_MATCH_KEYWORDS: |
case HH_MATCH_KEYWORDS: |
588 |
|
// TODO MD split pattern using space and highlight each segment |
|
589 |
589 |
keywordsParsedLine = strdup(pattern); |
keywordsParsedLine = strdup(pattern); |
590 |
|
keywordsAllMatch = true; |
|
591 |
590 |
keywordsPointerToDelete = keywordsParsedLine; |
keywordsPointerToDelete = keywordsParsedLine; |
592 |
591 |
while (true) { |
while (true) { |
593 |
592 |
keywordsToken = strtok_r(keywordsParsedLine, " ", &keywordsSavePtr); |
keywordsToken = strtok_r(keywordsParsedLine, " ", &keywordsSavePtr); |
|
... |
... |
void print_selection_row(char *text, int y, int width, char *pattern) |
602 |
601 |
|
|
603 |
602 |
break; |
break; |
604 |
603 |
} |
} |
|
604 |
|
color_attr_on(COLOR_PAIR(HH_COLOR_NORMAL)); |
605 |
605 |
color_attr_off(A_BOLD); |
color_attr_off(A_BOLD); |
606 |
606 |
} |
} |
607 |
607 |
} |
} |
|
... |
... |
void loop_to_select(Hstr *hstr) |
771 |
771 |
color_init_pair(HH_COLOR_HIROW, COLOR_WHITE, COLOR_GREEN); |
color_init_pair(HH_COLOR_HIROW, COLOR_WHITE, COLOR_GREEN); |
772 |
772 |
color_init_pair(HH_COLOR_PROMPT, COLOR_BLUE, -1); |
color_init_pair(HH_COLOR_PROMPT, COLOR_BLUE, -1); |
773 |
773 |
color_init_pair(HH_COLOR_DELETE, COLOR_WHITE, COLOR_RED); |
color_init_pair(HH_COLOR_DELETE, COLOR_WHITE, COLOR_RED); |
|
774 |
|
color_init_pair(HH_COLOR_MATCH, COLOR_YELLOW, -1); |
774 |
775 |
} |
} |
775 |
776 |
|
|
776 |
777 |
color_attr_on(COLOR_PAIR(HH_COLOR_NORMAL)); |
color_attr_on(COLOR_PAIR(HH_COLOR_NORMAL)); |