Skip to main content

find

Function find 

pub fn find(
    cursor: &mut Cursor<'_, RopeInfo>,
    lines: &mut LinesRaw<'_>,
    cm: CaseMatching,
    pat: &str,
    regex: Option<&Regex>,
) -> Option<usize>
Expand description

Finds a pattern string in the rope referenced by the cursor, starting at the current location of the cursor (and finding the first match). Both case sensitive and case insensitive matching is provided, controlled by the cm parameter. The regex parameter controls whether the query should be considered as a regular expression.

On success, the cursor is updated to immediately follow the found string. On failure, the cursor’s position is indeterminate.

Can panic if pat is empty.