robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. Keyesfix(lua): vim.regex():match_str abort in Luv callback #4100880cd482577

master
1.7 KiB40 linesraw
1--- @meta
2-- This file is NOT generated, edit it directly.
3error('Cannot require a meta file')
4
5-- luacheck: no unused args
6
7--- @brief The `vim.regex` interface allows Lua code to use Vim regexes.
8--- - Matches within a single line.
9--- - Does not check for interrupts (CTRL-C), so can be used from an |api-fast| context.
10
11--- Parses the Vim regex `re` and returns a regex object. Regexes are "magic" and case-sensitive by
12--- default, regardless of 'magic' and 'ignorecase'. They can be controlled with flags, see |/magic|
13--- and |/ignorecase|.
14--- @param re string
15--- @return vim.regex
16function vim.regex(re) end
17
18--- @nodoc
19--- @class vim.regex
20local regex = {} -- luacheck: no unused
21
22--- Matches string `str` against this regex. To match the string precisely, surround the regex with
23--- "^" and "$". Returns the byte indices for the start and end of the match, or `nil` if there is
24--- no match. Because any integer is "truthy", `regex:match_str()` can be directly used as
25--- a condition in an if-statement.
26--- @param str string
27--- @return integer? # match start (byte index), or `nil` if no match
28--- @return integer? # match end (byte index), or `nil` if no match
29function regex:match_str(str) end
30
31--- Matches line at `line_idx` (zero-based) in buffer `buf`. Match is restricted to byte index
32--- range `start` and `end_` if given, otherwise see |regex:match_str()|. Returned byte indices are
33--- relative to `start` if given.
34--- @param buf integer
35--- @param line_idx integer
36--- @param start? integer
37--- @param end_? integer
38--- @return integer? # match start (byte index) relative to `start`, or `nil` if no match
39--- @return integer? # match end (byte index) relative to `start`, or `nil` if no match
40function regex:match_line(buf, line_idx, start, end_) end