aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
authorJakub Łuczyński <doubleloop@users.noreply.github.com>2023-03-25 09:28:59 +0100
committerGitHub <noreply@github.com>2023-03-25 16:28:59 +0800
commit42876ddc7ad7d3dac3e1caf2494f402e7eb25a88 (patch)
treedbb018a52c9f36d619a587844f43acb0bf9c84c6 /runtime/doc/lua.txt
parent063e93864a7e99ac1c4781bbe4ea63c0adb075a8 (diff)
downloadrneovim-42876ddc7ad7d3dac3e1caf2494f402e7eb25a88.tar.gz
rneovim-42876ddc7ad7d3dac3e1caf2494f402e7eb25a88.tar.bz2
rneovim-42876ddc7ad7d3dac3e1caf2494f402e7eb25a88.zip
docs: more details about vim.region (#21116)
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 2baae3a123..018c6ce5a4 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1510,7 +1510,8 @@ print({...}) *vim.print()*
region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
Get a table of lines with start, end columns for a region marked by two
- points
+ points. Input and output positions are (0,0)-indexed and indicate byte
+ positions.
Parameters: ~
• {bufnr} (integer) number of buffer
@@ -1518,11 +1519,12 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
region
• {pos2} integer[] (line, column) tuple marking end of region
• {regtype} (string) type of selection, see |setreg()|
- • {inclusive} (boolean) indicating whether the selection is
- end-inclusive
+ • {inclusive} (boolean) indicating whether column of pos2 is inclusive
Return: ~
- (table) region Table of the form `{linenr = {startcol,endcol}}`
+ (table) region Table of the form `{linenr = {startcol,endcol}}`.
+ `endcol` is exclusive, and whole lines are marked with
+ `{startcol,endcol} = {0,-1}`.
schedule_wrap({cb}) *vim.schedule_wrap()*
Defers callback `cb` until the Nvim API is safe to call.