File src/hstr.c changed (mode: 100644) (index a1059d8..80b18d2) |
103 |
103 |
#define HH_CONFIG_KEYWORDS "keywords" |
#define HH_CONFIG_KEYWORDS "keywords" |
104 |
104 |
#define HH_CONFIG_SORTING "rawhistory" |
#define HH_CONFIG_SORTING "rawhistory" |
105 |
105 |
#define HH_CONFIG_FAVORITES "favorites" |
#define HH_CONFIG_FAVORITES "favorites" |
|
106 |
|
#define HH_CONFIG_NOCONFIRM "noconfirm" |
106 |
107 |
// 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 |
107 |
108 |
#define HH_CONFIG_PROMPT_BOTTOM "prompt-bottom" |
#define HH_CONFIG_PROMPT_BOTTOM "prompt-bottom" |
108 |
109 |
#define HH_CONFIG_BLACKLIST "blacklist" |
#define HH_CONFIG_BLACKLIST "blacklist" |
|
... |
... |
typedef struct { |
274 |
275 |
|
|
275 |
276 |
unsigned char theme; |
unsigned char theme; |
276 |
277 |
bool keepPage; // do NOT clear page w/ selection on HH exit |
bool keepPage; // do NOT clear page w/ selection on HH exit |
|
278 |
|
bool noConfirm; // do NOT ask for confirmation on history entry delete |
277 |
279 |
int bigKeys; |
int bigKeys; |
278 |
280 |
int debugLevel; |
int debugLevel; |
279 |
281 |
|
|
|
... |
... |
void hstr_get_env_configuration(Hstr *hstr) |
383 |
385 |
if(strstr(hstr_config,HH_CONFIG_KEEP_PAGE)) { |
if(strstr(hstr_config,HH_CONFIG_KEEP_PAGE)) { |
384 |
386 |
hstr->keepPage=true; |
hstr->keepPage=true; |
385 |
387 |
} |
} |
|
388 |
|
if(strstr(hstr_config,HH_CONFIG_NOCONFIRM)) { |
|
389 |
|
hstr->noConfirm=true; |
|
390 |
|
} |
386 |
391 |
|
|
387 |
392 |
if(strstr(hstr_config,HH_CONFIG_DEBUG)) { |
if(strstr(hstr_config,HH_CONFIG_DEBUG)) { |
388 |
393 |
hstr->debugLevel=HH_DEBUG_LEVEL_DEBUG; |
hstr->debugLevel=HH_DEBUG_LEVEL_DEBUG; |
|
... |
... |
void loop_to_select(Hstr *hstr) |
1057 |
1062 |
msg=malloc(strlen(delete)+1); |
msg=malloc(strlen(delete)+1); |
1058 |
1063 |
strcpy(msg,delete); |
strcpy(msg,delete); |
1059 |
1064 |
|
|
1060 |
|
print_confirm_delete(msg, hstr); |
|
1061 |
|
cc = wgetch(stdscr); |
|
1062 |
|
if(cc == 'y') { |
|
|
1065 |
|
if(!hstr->noConfirm) { |
|
1066 |
|
print_confirm_delete(msg, hstr); |
|
1067 |
|
cc = wgetch(stdscr); |
|
1068 |
|
} |
|
1069 |
|
if(hstr->noConfirm || cc == 'y') { |
1063 |
1070 |
deletedOccurences=remove_from_history_model(msg, hstr); |
deletedOccurences=remove_from_history_model(msg, hstr); |
1064 |
1071 |
result=hstr_print_selection(maxHistoryItems, pattern, hstr); |
result=hstr_print_selection(maxHistoryItems, pattern, hstr); |
1065 |
1072 |
print_cmd_deleted_label(msg, deletedOccurences, hstr); |
print_cmd_deleted_label(msg, deletedOccurences, hstr); |