mirror of
https://github.com/neovim/neovim.git
synced 2025-12-25 07:39:11 +00:00
Problem: getregionpos() depends on 'linebreak' setting
Solution: Reset linebreak setting temporarily (McAuley Penney)
When a line is wrapped on word boundaries, getregionpos() may report a
different end column for a visual block than the cursor position used to
define the selection.
Update the blockwise calculation in getregionpos() to use the same
wrapping assumptions as visual block mode, so the reported region
matches the selection boundaries.
Add a regression test that forces wrapping and checks that the end
position stays consistent under "setlocal wrap" and "setlocal
linebreak".
closes: vim/vim#19006
8ea0e7205c
Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>