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 ed5e16a82d85234660d0e83a73c78ae08e0e1410

UP/DOWN line highlighting in tegexp matching mode works.
Author: Martin Dvorak
Author date (UTC): 2014-04-26 04:00
Committer name: Martin Dvorak
Committer date (UTC): 2014-04-26 04:00
Parent(s): a06d94d0a4b93e6855396a8f7531cd815a7a5800
Signing key:
Tree: e9768a1f696be3b33a5ef4bff34924eeb93754a7
File Lines added Lines deleted
src/hstr.c 14 5
File src/hstr.c changed (mode: 100644) (index 51dedbf..03e7fe5)
... ... char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr)
507 507 move(Y_OFFSET_ITEMS, 0); move(Y_OFFSET_ITEMS, 0);
508 508 clrtobot(); clrtobot();
509 509
510 char buffer[CMDLINE_LNG];
511 510 int start, end; int start, end;
512
511 char buffer[CMDLINE_LNG];
513 512 for (i = 0; i<height; ++i) { for (i = 0; i<height; ++i) {
514 513 if(i<hstr->selectionSize) { if(i<hstr->selectionSize) {
515 514 if(pattern && strlen(pattern)) { if(pattern && strlen(pattern)) {
 
... ... char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr)
536 535 return result; return result;
537 536 } }
538 537
539 void highlight_selection(int selectionCursorPosition, int previousSelectionCursorPosition, char *prefix, Hstr *hstr)
538 void highlight_selection(int selectionCursorPosition, int previousSelectionCursorPosition, char *pattern, Hstr *hstr)
540 539 { {
541 540 if(previousSelectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { if(previousSelectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) {
542 // TODO regexp match instead of prefix one level up
541 char buffer[CMDLINE_LNG];
542 if(pattern && strlen(pattern) && hstr->historyMatch==HH_MATCH_REGEXP) {
543 int start=hstr->selectionRegexpMatch[previousSelectionCursorPosition].rm_so;
544 int end=hstr->selectionRegexpMatch[previousSelectionCursorPosition].rm_eo-start;
545 strncpy(buffer,
546 hstr->selection[previousSelectionCursorPosition]+start,
547 end);
548 buffer[end]=0;
549 } else {
550 strcpy(buffer, pattern);
551 }
543 552 print_selection_row( print_selection_row(
544 553 hstr->selection[previousSelectionCursorPosition], hstr->selection[previousSelectionCursorPosition],
545 554 Y_OFFSET_ITEMS+previousSelectionCursorPosition, Y_OFFSET_ITEMS+previousSelectionCursorPosition,
546 555 getmaxx(stdscr), getmaxx(stdscr),
547 prefix);
556 buffer);
548 557 } }
549 558 if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { if(selectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) {
550 559 hstr_print_highlighted_selection_row( hstr_print_highlighted_selection_row(
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