File src/hstr.c changed (mode: 100644) (index b9250dc..c98b42f) |
44 |
44 |
#define K_CTRL_X 24 |
#define K_CTRL_X 24 |
45 |
45 |
#define K_CTRL_Z 26 |
#define K_CTRL_Z 26 |
46 |
46 |
|
|
|
47 |
|
#define K_ESC 27 |
47 |
48 |
#define K_TAB 9 |
#define K_TAB 9 |
48 |
|
|
|
|
49 |
|
#define K_BACKSPACE 127 |
49 |
50 |
#define K_ENTER 10 |
#define K_ENTER 10 |
50 |
|
#define K_ESC 27 |
|
51 |
51 |
|
|
52 |
52 |
#define color_attr_on(C) if(terminalHasColors) { attron(C); } |
#define color_attr_on(C) if(terminalHasColors) { attron(C); } |
53 |
53 |
#define color_attr_off(C) if(terminalHasColors) { attroff(C); } |
#define color_attr_off(C) if(terminalHasColors) { attroff(C); } |
|
... |
... |
char *selection_loop(HistoryItems *history) |
352 |
352 |
if(!skip) { |
if(!skip) { |
353 |
353 |
c = wgetch(stdscr); |
c = wgetch(stdscr); |
354 |
354 |
} else { |
} else { |
|
355 |
|
if(strlen(prefix)>0) { |
|
356 |
|
color_attr_on(A_BOLD); |
|
357 |
|
mvprintw(y, basex, "%s", prefix); |
|
358 |
|
color_attr_off(A_BOLD); |
|
359 |
|
cursorX=getcurx(stdscr); |
|
360 |
|
cursorY=getcury(stdscr); |
|
361 |
|
result = print_selection(maxHistoryItems, prefix, history); |
|
362 |
|
move(cursorY, cursorX); |
|
363 |
|
} |
355 |
364 |
skip=FALSE; |
skip=FALSE; |
356 |
365 |
continue; |
continue; |
357 |
366 |
} |
} |
|
... |
... |
char *selection_loop(HistoryItems *history) |
392 |
401 |
prefix[0]=0; |
prefix[0]=0; |
393 |
402 |
mvprintw(y, basex, ""); |
mvprintw(y, basex, ""); |
394 |
403 |
clrtoeol(); |
clrtoeol(); |
|
404 |
|
case K_BACKSPACE: |
395 |
405 |
case KEY_BACKSPACE: |
case KEY_BACKSPACE: |
396 |
406 |
if(strlen(prefix)>0) { |
if(strlen(prefix)>0) { |
397 |
407 |
prefix[strlen(prefix)-1]=0; |
prefix[strlen(prefix)-1]=0; |
File src/hstr_history.c changed (mode: 100644) (index 6a9e329..c4a82ac) |
... |
... |
typedef struct { |
23 |
23 |
static HistoryItems *prioritizedHistory; |
static HistoryItems *prioritizedHistory; |
24 |
24 |
static bool dirty; |
static bool dirty; |
25 |
25 |
#define BLACKLIST_SIZE 5 |
#define BLACKLIST_SIZE 5 |
26 |
|
static const char *commandBlacklist[] = {"ls", "pwd", "cd", "hh", "mc"}; |
|
|
26 |
|
static const char *commandBlacklist[] = { |
|
27 |
|
"ls", "pwd", "cd", "cd ..", "hh", "mc", |
|
28 |
|
"ls ", "pwd ", "cd ", "cd .. ", "hh ", "mc " |
|
29 |
|
}; |
27 |
30 |
|
|
28 |
31 |
#ifdef DEBUG_RADIX |
#ifdef DEBUG_RADIX |
29 |
32 |
#define DEBUG_RADIXSORT() radixsort_stat(&rs); exit(0) |
#define DEBUG_RADIXSORT() radixsort_stat(&rs); exit(0) |