mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
vim-patch:9.1.0394: Cannot get a list of positions describing a region
Problem: Cannot get a list of positions describing a region
(Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
(Shougo Matsushita)
fixes: vim/vim#14609
closes: vim/vim#14617
b4757e627e
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
22
runtime/lua/vim/_meta/vimfn.lua
generated
22
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -3581,6 +3581,28 @@ function vim.fn.getreginfo(regname) end
|
||||
--- @return string[]
|
||||
function vim.fn.getregion(pos1, pos2, opts) end
|
||||
|
||||
--- 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.
|
||||
--- The "off" number is zero, unless 'virtualedit' is used. Then
|
||||
--- 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.
|
||||
---
|
||||
--- @param pos1 table
|
||||
--- @param pos2 table
|
||||
--- @param opts? table
|
||||
--- @return integer[][][]
|
||||
function vim.fn.getregionpos(pos1, pos2, opts) end
|
||||
|
||||
--- The result is a String, which is type of register {regname}.
|
||||
--- The value will be one of:
|
||||
--- "v" for |charwise| text
|
||||
|
||||
Reference in New Issue
Block a user