summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_core/stringbuffer.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-12-28 07:01:10 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-12-28 07:01:45 +0800
commite53accf8ec5a2cb4522af8fe477acebea5c0ce1b (patch)
tree52121b22e0c5766bd1a2f10eee735be710ac59ff /runtime/lua/vim/_core/stringbuffer.lua
parent922816877febf397fe854f01d8013a510d73f1d2 (diff)
vim-patch:9.1.2019: inconsistent cursor encoding past EOL with ve=all
Problem: When virtualedit is set to all, the cursor is supposed to be permitted to reside anywhere, including on the virtual space beyond the end of the buffer's text. Switching modes triggered a routine that "fixed" a cursor that was past the end of the line by shifting it back to the last actual character in the line and compensating with a virtual column offset. While visually identical, this re-encoding changed the underlying byte index, causing position-reporting functions to return inconsistent values after a mode change. Solution: Skip this coordinate adjustment when virtual editing is fully enabled. By treating the line terminator as a valid, stable position, the cursor’s internal representation remains unchanged when entering or exiting Visual mode, ensuring consistent coordinate reporting. Add a regression test to check this functionality. (McAuley Penney) fixes: vim/vim#16276 closes: vim/vim#19009 https://github.com/vim/vim/commit/491f0fa4574207b311f399a5a454033c79772872 Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
Diffstat (limited to 'runtime/lua/vim/_core/stringbuffer.lua')
0 files changed, 0 insertions, 0 deletions