[vim/vim] Cursor position incorrect when wrapped virtual text property moved in CursorMoved (Issue #10898)

12 views
Skip to first unread message

Ben Jackson

unread,
Aug 11, 2022, 5:00:53 PM8/11/22
to vim/vim, Subscribed

Steps to reproduce

call prop_type_add( 'prop', #{ highlight: 'Error' } )
let g:multi_line_text = repeat( 'x', &columns * 4 )

let g:prop_id = v:null
function! Update()
  if line( '.' ) == 1
    let g:prop_id = prop_add( 1, 0, #{ type: 'prop', text_algin: 'right', text_wrap: 'wrap', text: g:multi_line_text } )
  elseif g:prop_id != v:null
    call prop_remove( #{ id: g:prop_id } )
    let g:prop_id = v:null
  endif
endfunction

autocmd CursorMoved * call Update()
  • vim --clean -S test.vim test.vim
  • (check the cursor is on line 1, else go to line 1) - see the virtual text is wrapped across multiple lines
  • j - move the cursor down 1 line

Actual behaviour is the cursor is drawn on line 6 (though reports line 2)

Expected behaviour

Cursor is drawn on line 2.

Version of Vim

9.0.193

Environment

macOS arm64

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10898@github.com>

Bram Moolenaar

unread,
Aug 12, 2022, 8:06:38 AM8/12/22
to vim/vim, Subscribed

Closed #10898 as completed via 326c5d3.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/10898/issue_event/7178682867@github.com>

Reply all
Reply to author
Forward
0 new messages