Skip to main content

core.doc.search

Provides the base in-place search functionality for documents.

local search = require "core.doc.search"

core.doc.searchoptions

Options used when performing a search.

no_case

(field) no_case: boolean?

Perform case insensitive matches (ignored with lua patterns).


pattern

(field) pattern: boolean?

The text to find is a Lua pattern.


regex

(field) regex: boolean?

The text to find is a Regular expression.


reverse

(field) reverse: boolean?

Execute the search backward instead of forward.


whole_word

(field) whole_word: boolean?

Only match whole words.


wrap

(field) wrap: boolean?

If the end of document is reached start again from the start.


find

function core.doc.search.find(doc: core.doc, line: integer, col: integer, text: string, opt: core.doc.searchoptions)
-> integer
2. integer|unknown
3. integer
4. integer|unknown

Perform a search on a document with the given options.