vim-patch:9.1.0388: cursor() and getregion() don't handle v:maxcol well (#28602)

Problem:  cursor() and getregion() don't handle v:maxcol well.
Solution: Add special handling for v:maxcol like setpos() does.
          (zeertzjq)

closes: vim/vim#14698

2ffdae7948
This commit is contained in:
zeertzjq
2024-05-02 19:33:54 +08:00
committed by GitHub
parent d26943a6e1
commit c4627676f9
3 changed files with 35 additions and 4 deletions

View File

@@ -1702,6 +1702,9 @@ func Test_visual_getregion()
\ "'a"->getpos()->getregion(getpos("'a"), {'type': 'V' }))
call assert_equal(['one', 'two'],
\ "."->getpos()->getregion(getpos("'a"), {'type': "\<c-v>" }))
call feedkeys("\<ESC>jVj\<ESC>", 'tx')
call assert_equal(['two', 'three'], getregion(getpos("'<"), getpos("'>")))
call assert_equal(['two', 'three'], getregion(getpos("'>"), getpos("'<")))
#" Using List
call cursor(1, 1)