mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:8.1.2228: screenpos() returns wrong values when 'number' is set
Problem: screenpos() returns wrong values when 'number' is set. (Ben
Jackson)
Solution: Compare the column with the window width. (closes vim/vim#5133)
38ba4dce4a
This commit is contained in:
@@ -93,3 +93,18 @@ func Test_screenpos()
|
||||
close
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_screenpos_number()
|
||||
rightbelow new
|
||||
rightbelow 73vsplit
|
||||
call setline (1, repeat('x', 66))
|
||||
setlocal number
|
||||
redraw
|
||||
let winid = win_getid()
|
||||
let [winrow, wincol] = win_screenpos(winid)
|
||||
let pos = screenpos(winid, 1, 66)
|
||||
call assert_equal(winrow, pos.row)
|
||||
call assert_equal(wincol + 66 + 3, pos.col)
|
||||
close
|
||||
bwipe!
|
||||
endfunc
|
||||
|
Reference in New Issue
Block a user