xaizek / hstr (License: Apachev2) (since 2018-12-07)
Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history.
Commit d28d9fb18bcaa84cfad5e87a3e591f5becf75a64

Adding yellow highlighting of matching patterns for all C-e modes.
Author: Martin Dvorak
Author date (UTC): 2014-10-29 19:18
Committer name: Martin Dvorak
Committer date (UTC): 2014-10-29 19:18
Parent(s): e0f194912c2c34c477e42570b85714943d6d42a3
Signing key:
Tree: a0633f4dcb75c494ee68aea49c97335e6a27e635
File Lines added Lines deleted
src/hstr.c 4 3
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));
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/hstr

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/hstr

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master