| File src/hstr.c changed (mode: 100644) (index 03e7fe5..7df98ce) |
| ... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
| 511 |
511 |
char buffer[CMDLINE_LNG]; |
char buffer[CMDLINE_LNG]; |
| 512 |
512 |
for (i = 0; i<height; ++i) { |
for (i = 0; i<height; ++i) { |
| 513 |
513 |
if(i<hstr->selectionSize) { |
if(i<hstr->selectionSize) { |
|
514 |
|
// TODO make this function |
| 514 |
515 |
if(pattern && strlen(pattern)) { |
if(pattern && strlen(pattern)) { |
| 515 |
516 |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
if(hstr->historyMatch==HH_MATCH_REGEXP) { |
| 516 |
517 |
start=hstr->selectionRegexpMatch[i].rm_so; |
start=hstr->selectionRegexpMatch[i].rm_so; |
| |
| ... |
... |
char *hstr_print_selection(unsigned maxHistoryItems, char *pattern, Hstr *hstr) |
| 538 |
539 |
void highlight_selection(int selectionCursorPosition, int previousSelectionCursorPosition, char *pattern, Hstr *hstr) |
void highlight_selection(int selectionCursorPosition, int previousSelectionCursorPosition, char *pattern, Hstr *hstr) |
| 539 |
540 |
{ |
{ |
| 540 |
541 |
if(previousSelectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { |
if(previousSelectionCursorPosition!=SELECTION_CURSOR_IN_PROMPT) { |
|
542 |
|
// TODO make this function |
| 541 |
543 |
char buffer[CMDLINE_LNG]; |
char buffer[CMDLINE_LNG]; |
| 542 |
544 |
if(pattern && strlen(pattern) && hstr->historyMatch==HH_MATCH_REGEXP) { |
if(pattern && strlen(pattern) && hstr->historyMatch==HH_MATCH_REGEXP) { |
| 543 |
545 |
int start=hstr->selectionRegexpMatch[previousSelectionCursorPosition].rm_so; |
int start=hstr->selectionRegexpMatch[previousSelectionCursorPosition].rm_so; |
| |
| ... |
... |
void hstr_assemble_cmdline_pattern(int argc, char* argv[], Hstr* hstr) |
| 855 |
857 |
} |
} |
| 856 |
858 |
|
|
| 857 |
859 |
// TODO to be rewritten to getopt |
// TODO to be rewritten to getopt |
| 858 |
|
|
|
| 859 |
|
// TODO on unknown option make it filter |
|
| 860 |
|
// TODO on favorites - skip -f otherwise it becomes filter |
|
| 861 |
860 |
void hstr_get_cmdline_options(int argc, char *argv[], Hstr *hstr) |
void hstr_get_cmdline_options(int argc, char *argv[], Hstr *hstr) |
| 862 |
861 |
{ |
{ |
| 863 |
862 |
if(argc>0) { |
if(argc>0) { |