mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
vim-patch:9.1.0423: getregionpos() wrong with blockwise mode and multibyte
Problem: getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
Handle coladd properly (zeertzjq).
Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.
closes: vim/vim#14805
c95e64f41f
This commit is contained in:
10
runtime/lua/vim/_meta/vimfn.lua
generated
10
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -3592,10 +3592,12 @@ function vim.fn.getregion(pos1, pos2, opts) end
|
||||
--- "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.
|
||||
--- 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.
|
||||
---
|
||||
--- @param pos1 table
|
||||
--- @param pos2 table
|
||||
|
||||
Reference in New Issue
Block a user