This commit is contained in:
Martin Dvorak 2014-01-19 14:37:46 +01:00
parent a6d96409f8
commit 5f7ad2d699
2 changed files with 17 additions and 4 deletions

View file

@ -44,10 +44,10 @@
#define K_CTRL_X 24
#define K_CTRL_Z 26
#define K_TAB 9
#define K_ENTER 10
#define K_ESC 27
#define K_TAB 9
#define K_BACKSPACE 127
#define K_ENTER 10
#define color_attr_on(C) if(terminalHasColors) { attron(C); }
#define color_attr_off(C) if(terminalHasColors) { attroff(C); }
@ -352,6 +352,15 @@ char *selection_loop(HistoryItems *history)
if(!skip) {
c = wgetch(stdscr);
} else {
if(strlen(prefix)>0) {
color_attr_on(A_BOLD);
mvprintw(y, basex, "%s", prefix);
color_attr_off(A_BOLD);
cursorX=getcurx(stdscr);
cursorY=getcury(stdscr);
result = print_selection(maxHistoryItems, prefix, history);
move(cursorY, cursorX);
}
skip=FALSE;
continue;
}
@ -392,6 +401,7 @@ char *selection_loop(HistoryItems *history)
prefix[0]=0;
mvprintw(y, basex, "");
clrtoeol();
case K_BACKSPACE:
case KEY_BACKSPACE:
if(strlen(prefix)>0) {
prefix[strlen(prefix)-1]=0;

View file

@ -23,7 +23,10 @@ typedef struct {
static HistoryItems *prioritizedHistory;
static bool dirty;
#define BLACKLIST_SIZE 5
static const char *commandBlacklist[] = {"ls", "pwd", "cd", "hh", "mc"};
static const char *commandBlacklist[] = {
"ls", "pwd", "cd", "cd ..", "hh", "mc",
"ls ", "pwd ", "cd ", "cd .. ", "hh ", "mc "
};
#ifdef DEBUG_RADIX
#define DEBUG_RADIXSORT() radixsort_stat(&rs); exit(0)