diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-20 21:17:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 21:17:21 +0800 |
commit | 36a9da65472f1607568c9be9b91c06357e39fce4 (patch) | |
tree | 225a99d08431a6f295c01e60f17ccbe65075a57a /src/nvim/eval.lua | |
parent | 5c2616846aa4d85ba96adefea98ed50f46f7a291 (diff) | |
parent | e0259b9466a0dd62b74d4aa195b3c5e6c7a183d0 (diff) | |
download | rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.tar.gz rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.tar.bz2 rneovim-36a9da65472f1607568c9be9b91c06357e39fce4.zip |
Merge pull request #28854 from zeertzjq/vim-9.1.0394
vim-patch:9.1.{0394,0395,0423}: getregionpos()
Diffstat (limited to 'src/nvim/eval.lua')
-rw-r--r-- | src/nvim/eval.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index f0eeca2f10..58f2ac0acf 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -4414,6 +4414,33 @@ M.funcs = { returns = 'string[]', signature = 'getregion({pos1}, {pos2} [, {opts}])', }, + getregionpos = { + args = { 2, 3 }, + base = 1, + desc = [=[ + Same as |getregion()|, but returns a list of positions + describing the buffer text segments bound by {pos1} and + {pos2}. + The segments are a pair of positions for every line: > + [[{start_pos}, {end_pos}], ...] + < + The position is a |List| with four numbers: + [bufnum, lnum, col, off] + "bufnum" is the buffer number. + "lnum" and "col" are the position in the buffer. The first + column is 1. + If the "off" number of a starting position is non-zero, it is + the offset in screen columns from the start of the character. + E.g., a position within a <Tab> or after the last character. + If the "off" number of an ending position is non-zero, it is + the character's number of cells included in the selection, + otherwise the whole character is included. + ]=], + name = 'getregionpos', + params = { { 'pos1', 'table' }, { 'pos2', 'table' }, { 'opts', 'table' } }, + returns = 'integer[][][]', + signature = 'getregionpos({pos1}, {pos2} [, {opts}])', + }, getregtype = { args = { 0, 1 }, base = 1, |