[vim/vim] Moving cursor over a long line with virtual text, text_wrap and "list" enabled will move cursor visually to wrong line (Issue #12725)

29 views
Skip to first unread message

BigPeet

unread,
Aug 3, 2023, 7:09:07 PM8/3/23
to vim/vim, Subscribed

Steps to reproduce

  1. Save the following as test.vim:
vim9script
:80vsplit
# A
# B 40 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# C
# D
set list

prop_type_add('test', {highlight: 'Error'})
prop_add(4, 0, {
 'text': ' > 40 * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
 'type': 'test',
 'text_wrap': 'wrap',
})
  1. Execute vim --clean test.vim -S test.vim
  2. Move cursor to line 4 and move down (4Gj)

Expected behaviour

The text+virtual text in line 4 is longer than 80 characters and should wrap to the next (visual) line. The cursor should be on line 5 (C).

I.e. it shoud look something like this (I've taken this screenshot with nolist:
expected

The actual behavior looks like this:
actual

  1. The virtual text is obviously not wrapped.
  2. If you step over this line with the cursor, the cursor seems to skip the following line (C) and seems to be on (D) instead. This is only visually, though. If you enter Insert mode, it will be on line 5, as expected.

Version of Vim

9.0.1677

Environment

OS: Linux Mint 21.2
Terminal: gnome-terminal 3.44
Value of $TERM: xterm-256color
Shell: bash 5.1.16

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/12725@github.com>

BigPeet

unread,
Aug 3, 2023, 7:09:32 PM8/3/23
to vim/vim, Subscribed

Might be related to #11959


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/12725/1664746649@github.com>

Dylan Thacker-Smith

unread,
Feb 21, 2024, 11:30:13 AM2/21/24
to vim/vim, Subscribed

I found the relevant condition in the code:

https://github.com/vim/vim/blob/ffc712780fb3ba3f028a1bd4241bf1692d5172fd/src/drawline.c#L4136-L4150

where lcs_eol_one == -1 will be true after the end of line character has been added to the screen line. So it seems like that is where the bug is and it is just a matter of figuring out what the code should be.


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/12725/1957206271@github.com>

Christian Brabandt

unread,
Feb 24, 2024, 4:19:53 AM2/24/24
to vim/vim, Subscribed

Closed #12725 as completed via f548ae7.


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/12725/issue_event/11910413013@github.com>

Reply all
Reply to author
Forward
0 new messages