void print_selected_msg(void) { if(vle_mode_is(VISUAL_MODE)) { status_bar_messagef("-- %s -- ", describe_visual_mode()); update_vmode_input(); } else { status_bar_messagef("%d %s selected", curr_view->selected_files, curr_view->selected_files == 1 ? "file" : "files"); } curr_stats.save_msg = 2; }
void print_search_next_msg(const FileView *view, int backward) { const int match_number = get_current_entry(view)->search_match; const char search_type = backward ? '?' : '/'; status_bar_messagef("(%d of %d) %c%s", match_number, view->matches, search_type, cfg_get_last_search_pattern()); }
void view_pre(void) { if(curr_stats.save_msg == 0) { const char *const suffix = vi->auto_forward ? "(auto forwarding)" : ""; status_bar_messagef("-- VIEW -- %s", suffix); curr_stats.save_msg = 2; } }
static int search_menu_backwards(menu_info *m, int start_pos) { int match_up = -1; int match_down = -1; int x; for(x = m->len - 1; x > -1; x--) { if(!m->matches[x]) continue; if(match_up < 0) { if(x <= start_pos) match_up = x; } if(match_down < 0) { if(x > start_pos) match_down = x; } } if(match_up > -1 || match_down > -1) { int pos; if(!cfg.wrap_scan && match_up <= -1) { status_bar_errorf("Search hit TOP without match for: %s", m->regexp); return 1; } pos = (match_up > -1) ? match_up : match_down; clean_menu_position(m); move_to_menu_pos(pos, m); status_bar_messagef("%d %s", m->matching_entries, (m->matching_entries == 1) ? "match" : "matches"); } else { move_to_menu_pos(m->pos, m); if(!cfg.wrap_scan) status_bar_errorf("Search hit TOP without match for: %s", m->regexp); else status_bar_errorf("No matches for: %s", m->regexp); return 1; } return 0; }
void print_search_msg(const FileView *view, int backward) { if(view->matches == 0) { print_search_fail_msg(view, backward); } else { status_bar_messagef("%d of %d matching file%s for: %s", get_current_entry(view)->search_match, view->matches, (view->matches == 1) ? "" : "s", cfg_get_last_search_pattern()); } }
static void search(int backward) { if(menu->regexp != NULL) { int was_msg; menu->match_dir = backward ? UP : DOWN; was_msg = search_menu_list(NULL, menu); wrefresh(menu_win); if(!was_msg) status_bar_messagef("%c%s", backward ? '?' : '/', menu->regexp); } else { status_bar_error("No search pattern set"); } curr_stats.save_msg = 1; }
void menus_search(menu_state_t *m, int backward) { if(m->regexp == NULL) { status_bar_error("No search pattern set"); curr_stats.save_msg = 1; return; } m->backward_search = backward; (void)search_menu_list(NULL, m->d, 1); wrefresh(menu_win); if(m->matching_entries > 0) { status_bar_messagef("(%d of %d) %c%s", get_match_index(m), m->matching_entries, backward ? '?' : '/', m->regexp); } curr_stats.save_msg = 1; }
void menu_print_search_msg(const menu_state_t *m) { int cflags; regex_t re; int err; /* Can be NULL after regex compilation failure. */ if(m->regexp == NULL) { return; } cflags = get_regexp_cflags(m->regexp); err = regcomp(&re, m->regexp, cflags); if(err != 0) { status_bar_errorf("Regexp (%s) error: %s", m->regexp, get_regexp_error(err, &re)); regfree(&re); return; } regfree(&re); if(m->matching_entries > 0) { status_bar_messagef("%d of %d %s", get_match_index(m), m->matching_entries, (m->matching_entries == 1) ? "match" : "matches"); } else { status_bar_errorf("No matches for: %s", m->regexp); } }
void print_search_next_msg(const FileView *view, int backward) { status_bar_messagef("(%d of %d) %c%s", view->dir_entry[view->list_pos].search_match, view->matches, backward ? '?' : '/', cfg_get_last_search_pattern()); }