Beispiel #1
0
/* Looks for a search match in specified direction navigates to it if match is
 * found.  Wraps search around specified wrap start position, when requested.
 * Returns non-zero if something was found, otherwise zero is returned. */
static int
find_and_goto_pattern(FileView *view, int wrap_start, int backward)
{
    if(!find_and_goto_match(view, view->list_pos, backward))
    {
        if(!cfg.wrap_scan || !find_and_goto_match(view, wrap_start, backward))
        {
            return 0;
        }
    }
    fview_cursor_redraw(view);
    return 1;
}
Beispiel #2
0
int
goto_search_match(FileView *view, int backward)
{
	const int wrap_start = backward ? view->list_rows : -1;
	if(!find_and_goto_match(view, view->list_pos, backward))
	{
		if(!cfg.wrap_scan || !find_and_goto_match(view, wrap_start, backward))
		{
			return 0;
		}
	}

	/* Redraw the cursor which also might synchronize cursors of two views. */
	fview_cursor_redraw(view);
	/* Schedule redraw of the view to highlight search matches. */
	ui_view_schedule_redraw(view);

	return 1;
}