[vim/vim] [virtual text] text is inserted in-between the buffer line and the virtual-text line (Issue #11131)

200 views
Skip to first unread message

bfrg

unread,
Sep 14, 2022, 1:57:12 PM9/14/22
to vim/vim, Subscribed

Steps to reproduce

Run vim --clean test.vim -S test.vim, with

vim9script

colorscheme habamax

prop_type_add('test', {highlight: 'ModeMsg'})

prop_add(2, 0, {

    text:  '└─ Virtual text below the 2nd line',

    type: 'test',

    text_align: 'below',

    text_padding_left: 3

})

Now move the cursor to the 2nd line, press A and then <CR>. Result: The cursor jumps to the first column of the screen line containing the virtual-text. And the 3rd buffer line is drawn twice:

screenshot-2022-09-14_193919

While in insert mode, press some keys. Result: Text is inserted above the line containing the virtual text, but should be below it.

screenshot-2022-09-14_193930

Note: when we move the cursor to the 2nd line and press o in normal mode, the text will be correctly inserted below the virtual text.

Go back to normal mode and press u. Result: The inserted text is removed but the 3rd buffer line is drawn twice again:

screenshot-2022-09-14_194144

Expected behaviour

Text should be added below the virtual text when <CR> is pressed in insert mode, just like when o is pressed in normal-mode.

Version of Vim

9.0.465

Environment

Linux

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

bfrg

unread,
Sep 14, 2022, 2:00:51 PM9/14/22
to vim/vim, Subscribed

I just noticed that the virtual text isn't displayed at all when list is enabled.


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

bfrg

unread,
Sep 14, 2022, 2:06:38 PM9/14/22
to vim/vim, Subscribed

I just noticed that the virtual text isn't displayed at all when list is enabled. If list is enabled interactively on the command-line, the virtual text disappears.

If wrap is disabled, the virtual text appears again, i.e. :set list nowrap works fine, but :set list wrap doesn't. Though, in both cases the same issue occurs when <CR> pressed at the end of a text line containing virtual text below it.


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

Bram Moolenaar

unread,
Sep 14, 2022, 5:15:03 PM9/14/22
to vim/vim, Subscribed

Closed #11131 as completed via ebd0e8b.


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/11131/issue_event/7389600991@github.com>

Bram Moolenaar

unread,
Sep 14, 2022, 5:17:26 PM9/14/22
to vim/vim, Subscribed

I fixed the obvious problem, but I haven't tried if that also fixes all the other situations. Please create a new issue if you can still reproduce something.


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

Nick Jensen

unread,
Sep 14, 2022, 5:46:36 PM9/14/22
to vim/vim, Subscribed

:set list still hides the virtual text, and it is displayed again with :set nolist


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

Reply all
Reply to author
Forward
0 new messages