]> git.feebdaed.xyz Git - 0xmirror/vim.git/commit
patch 9.1.2017: getregionpos() depends on 'linebreak' setting
authorMcAuley Penney <jacobmpenney@gmail.com>
Tue, 23 Dec 2025 20:51:25 +0000 (20:51 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 23 Dec 2025 20:51:25 +0000 (20:51 +0000)
commit8ea0e7205cdd16dbddd8981bd2429eca22c7386d
tree41c3cbabffbfd25dfdd61e507b22ca048f920ebf
parent9d661b057e9f8e4d900b258fa4ed6a265751b7b7
patch 9.1.2017: getregionpos() depends on 'linebreak' setting

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: #19006

Signed-off-by: McAuley Penney <jacobmpenney@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/evalfunc.c
src/ops.c
src/proto/ops.pro
src/testdir/test_visual.vim
src/version.c