File src/hstr.c changed (mode: 100644) (index 6be8d85..e94e7d2) |
104 |
104 |
// MVP: model is the same regardless prompt is top or bottom - view is different |
// MVP: model is the same regardless prompt is top or bottom - view is different |
105 |
105 |
#define HH_CONFIG_PROMPT_BOTTOM "prompt-bottom" |
#define HH_CONFIG_PROMPT_BOTTOM "prompt-bottom" |
106 |
106 |
#define HH_CONFIG_BLACKLIST "blacklist" |
#define HH_CONFIG_BLACKLIST "blacklist" |
|
107 |
|
#define HH_CONFIG_KEEP_PAGE "keepage" |
107 |
108 |
#define HH_CONFIG_DEBUG "debug" |
#define HH_CONFIG_DEBUG "debug" |
108 |
109 |
#define HH_CONFIG_WARN "warning" |
#define HH_CONFIG_WARN "warning" |
109 |
110 |
#define HH_CONFIG_BIG_KEYS_SKIP "big-keys-skip" |
#define HH_CONFIG_BIG_KEYS_SKIP "big-keys-skip" |
|
... |
... |
typedef struct { |
271 |
272 |
bool unique; |
bool unique; |
272 |
273 |
|
|
273 |
274 |
unsigned char theme; |
unsigned char theme; |
|
275 |
|
bool keepPage; // do NOT clear page w/ selection on HH exit |
274 |
276 |
int bigKeys; |
int bigKeys; |
275 |
277 |
int debugLevel; |
int debugLevel; |
276 |
278 |
|
|
|
... |
... |
void hstr_get_env_configuration(Hstr *hstr) |
377 |
379 |
if(strstr(hstr_config,HH_CONFIG_BLACKLIST)) { |
if(strstr(hstr_config,HH_CONFIG_BLACKLIST)) { |
378 |
380 |
hstr->blacklist.useFile=true; |
hstr->blacklist.useFile=true; |
379 |
381 |
} |
} |
|
382 |
|
if(strstr(hstr_config,HH_CONFIG_KEEP_PAGE)) { |
|
383 |
|
hstr->keepPage=true; |
|
384 |
|
} |
380 |
385 |
|
|
381 |
386 |
if(strstr(hstr_config,HH_CONFIG_DEBUG)) { |
if(strstr(hstr_config,HH_CONFIG_DEBUG)) { |
382 |
387 |
hstr->debugLevel=HH_DEBUG_LEVEL_DEBUG; |
hstr->debugLevel=HH_DEBUG_LEVEL_DEBUG; |
|
... |
... |
void loop_to_select(Hstr *hstr) |
1330 |
1335 |
break; |
break; |
1331 |
1336 |
} |
} |
1332 |
1337 |
} |
} |
1333 |
|
hstr_curses_stop(); |
|
|
1338 |
|
hstr_curses_stop(hstr->keepPage); |
1334 |
1339 |
|
|
1335 |
1340 |
if(result!=NULL) { |
if(result!=NULL) { |
1336 |
1341 |
if(fixCommand) { |
if(fixCommand) { |
File src/hstr_curses.c changed (mode: 100644) (index 9c28b86..f266c73) |
... |
... |
void hstr_curses_start() |
26 |
26 |
initscr(); |
initscr(); |
27 |
27 |
keypad(stdscr, TRUE); |
keypad(stdscr, TRUE); |
28 |
28 |
noecho(); |
noecho(); |
29 |
|
nonl(); |
|
|
29 |
|
nonl(); // prevent carriage return from being mapped to newline |
30 |
30 |
terminalHasColors=has_colors(); |
terminalHasColors=has_colors(); |
31 |
31 |
if(terminalHasColors) { |
if(terminalHasColors) { |
32 |
32 |
start_color(); |
start_color(); |
|
... |
... |
bool terminal_has_colors() { |
38 |
38 |
return terminalHasColors; |
return terminalHasColors; |
39 |
39 |
} |
} |
40 |
40 |
|
|
41 |
|
void hstr_curses_stop() { |
|
42 |
|
// removed to leave content in case of alternative page - clear(); |
|
|
41 |
|
void hstr_curses_stop(bool keepPage) { |
|
42 |
|
if(!keepPage) { |
|
43 |
|
clear(); |
|
44 |
|
} |
43 |
45 |
refresh(); |
refresh(); |
44 |
46 |
doupdate(); |
doupdate(); |
45 |
47 |
endwin(); |
endwin(); |