aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-10-07 08:27:38 -0700
committerGitHub <noreply@github.com>2024-10-07 08:27:38 -0700
commit61f1b091ea97793f9b644cebf6c84cf6bbb4f0bc (patch)
tree114b049d97f362372486a489668cc8e07063eb76 /runtime/doc/lua.txt
parent50f006b61774311e67e6948cd863bd503e4bcdfb (diff)
downloadrneovim-61f1b091ea97793f9b644cebf6c84cf6bbb4f0bc.tar.gz
rneovim-61f1b091ea97793f9b644cebf6c84cf6bbb4f0bc.tar.bz2
rneovim-61f1b091ea97793f9b644cebf6c84cf6bbb4f0bc.zip
docs: dev-arch, focusable windows #30510
- 'statuscolumn' is no longer experimental - add tags for popular searches on neovim.io
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt31
1 files changed, 20 insertions, 11 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index de0c6f27b5..396f24a1aa 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -3652,10 +3652,10 @@ within a single line.
*regex:match_line()*
regex:match_line({bufnr}, {line_idx}, {start}, {end_})
- Match line {line_idx} (zero-based) in buffer {bufnr}. If {start} and {end}
- are supplied, match only this byte index range. Otherwise see
- |regex:match_str()|. If {start} is used, then the returned byte indices
- will be relative {start}.
+ Matches line at `line_idx` (zero-based) in buffer `bufnr`. Match is
+ restricted to byte index range `start` and `end_` if given, otherwise see
+ |regex:match_str()|. Returned byte indices are relative to `start` if
+ given.
Parameters: ~
• {bufnr} (`integer`)
@@ -3663,19 +3663,28 @@ regex:match_line({bufnr}, {line_idx}, {start}, {end_})
• {start} (`integer?`)
• {end_} (`integer?`)
+ Return (multiple): ~
+ (`integer?`) match start (byte index) relative to `start`, or `nil` if
+ no match
+ (`integer?`) match end (byte index) relative to `start`, or `nil` if
+ no match
+
regex:match_str({str}) *regex:match_str()*
- Match the string against the regex. If the string should match the regex
- precisely, surround the regex with `^` and `$`. If there was a match, the
- byte indices for the beginning and end of the match are returned. When
- there is no match, `nil` is returned. Because any integer is "truthy",
- `regex:match_str()` can be directly used as a condition in an
- if-statement.
+ Matches string `str` against this regex. To match the string precisely,
+ surround the regex with "^" and "$". Returns the byte indices for the
+ start and end of the match, or `nil` if there is no match. Because any
+ integer is "truthy", `regex:match_str()` can be directly used as a
+ condition in an if-statement.
Parameters: ~
• {str} (`string`)
+ Return (multiple): ~
+ (`integer?`) match start (byte index), or `nil` if no match
+ (`integer?`) match end (byte index), or `nil` if no match
+
vim.regex({re}) *vim.regex()*
- Parse the Vim regex {re} and return a regex object. Regexes are "magic"
+ Parses the Vim regex `re` and returns a regex object. Regexes are "magic"
and case-sensitive by default, regardless of 'magic' and 'ignorecase'.
They can be controlled with flags, see |/magic| and |/ignorecase|.