File src/hstr.c changed (mode: 100644) (index e0aa26e..9f9ae60) |
59 |
59 |
#define HH_COLOR_DELETE 4 |
#define HH_COLOR_DELETE 4 |
60 |
60 |
|
|
61 |
61 |
#define ENV_VAR_HH_CONFIG "HH_CONFIG" |
#define ENV_VAR_HH_CONFIG "HH_CONFIG" |
|
62 |
|
#define HH_CONFIG_HICOLOR "hicolor" |
|
63 |
|
#define HH_CONFIG_CASE "casesensitive" |
|
64 |
|
#define HH_CONFIG_SORTING "rawhistory" |
|
65 |
|
|
|
66 |
|
#define SPACE_PADDING " " |
62 |
67 |
|
|
63 |
68 |
#ifdef DEBUG_KEYS |
#ifdef DEBUG_KEYS |
64 |
69 |
#define LOGKEYS(Y,KEY) mvprintw(Y, 0, "Key: '%3d' / Char: '%c'", KEY, KEY); clrtoeol() |
#define LOGKEYS(Y,KEY) mvprintw(Y, 0, "Key: '%3d' / Char: '%c'", KEY, KEY); clrtoeol() |
|
... |
... |
void get_env_configuration() |
108 |
113 |
{ |
{ |
109 |
114 |
char *hhconfig=getenv(ENV_VAR_HH_CONFIG); |
char *hhconfig=getenv(ENV_VAR_HH_CONFIG); |
110 |
115 |
if(hhconfig && strlen(hhconfig)>0) { |
if(hhconfig && strlen(hhconfig)>0) { |
111 |
|
if(strstr(hhconfig,"hicolor")) { |
|
|
116 |
|
if(strstr(hhconfig,HH_CONFIG_HICOLOR)) { |
112 |
117 |
hicolor=TRUE; |
hicolor=TRUE; |
113 |
118 |
} |
} |
|
119 |
|
if(strstr(hhconfig,HH_CONFIG_CASE)) { |
|
120 |
|
caseSensitive=TRUE; |
|
121 |
|
} |
|
122 |
|
if(strstr(hhconfig,HH_CONFIG_SORTING)) { |
|
123 |
|
defaultOrder=TRUE; |
|
124 |
|
} |
114 |
125 |
} |
} |
115 |
126 |
} |
} |
116 |
127 |
|
|
|
... |
... |
unsigned make_selection(char *prefix, HistoryItems *history, int maxSelectionCou |
263 |
274 |
|
|
264 |
275 |
void print_selection_row(char *text, int y, int width, char *prefix) { |
void print_selection_row(char *text, int y, int width, char *prefix) { |
265 |
276 |
snprintf(screenLine, width, " %s", text); |
snprintf(screenLine, width, " %s", text); |
266 |
|
mvprintw(y, 0, screenLine); |
|
|
277 |
|
mvprintw(y, 0, screenLine); clrtoeol(); |
267 |
278 |
if(prefix!=NULL && strlen(prefix)>0) { |
if(prefix!=NULL && strlen(prefix)>0) { |
268 |
279 |
color_attr_on(A_BOLD); |
color_attr_on(A_BOLD); |
269 |
280 |
char *p; |
char *p; |
|
... |
... |
void print_highlighted_selection_row(char *text, int y, int width) { |
286 |
297 |
} else { |
} else { |
287 |
298 |
color_attr_on(A_REVERSE); |
color_attr_on(A_REVERSE); |
288 |
299 |
} |
} |
289 |
|
snprintf(screenLine, getmaxx(stdscr), "%s%s", (terminal_has_colors()?" ":">"), text); |
|
|
300 |
|
snprintf(screenLine, getmaxx(stdscr), |
|
301 |
|
"%s%s" SPACE_PADDING SPACE_PADDING SPACE_PADDING, |
|
302 |
|
(terminal_has_colors()?" ":">"), text); |
290 |
303 |
mvprintw(y, 0, "%s", screenLine); |
mvprintw(y, 0, "%s", screenLine); |
291 |
304 |
if(hicolor) { |
if(hicolor) { |
292 |
305 |
color_attr_on(COLOR_PAIR(1)); |
color_attr_on(COLOR_PAIR(1)); |