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 2478e982a9e727e02e5e79aef2a914cc191e81f1

Fixed #59 by the implementation of regexp matching.
Author: Martin Dvorak
Author date (UTC): 2014-04-27 06:08
Committer name: Martin Dvorak
Committer date (UTC): 2014-04-27 06:08
Parent(s): 53b33464b8e66cdee090191a1f2859fb55f6b3b0
Signing key:
Tree: b0d49d70c5120054d2504c9fe9587454aab21a08
File Lines added Lines deleted
src/hstr.c 5 6
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 } }
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