Skip to content

Allow virtual text to overlay buffer text#19661

Open
64-bitman wants to merge 5 commits intovim:masterfrom
64-bitman:textprop_overlay
Open

Allow virtual text to overlay buffer text#19661
64-bitman wants to merge 5 commits intovim:masterfrom
64-bitman:textprop_overlay

Conversation

@64-bitman
Copy link
Copy Markdown
Contributor

@64-bitman 64-bitman commented Mar 13, 2026

Fixes #15007

Should work correctly with multibyte and double width characters. If the overlay text can't fully cover a double width character, then a '>' will be substituted in.

If the overlay is placed over double-width characters, then the cursor will appear to skip some characters. I initially thought this was a bug, however it seems like Neovim has the same behaviour. Thinking about it more, it makes sense.

Here is a demo program to test

vim9script

prop_type_add("Test", {highlight: "ErrorMsg"})

command -nargs=0 Prop {
    prop_add(line('.'), col('.'), {type: "Test", text: "ABC", text_align: "overlay"})
}

command -nargs=0 Clear prop_clear(line('.'))

noremap <leader>pp <cmd>Prop<cr>
noremap <leader>pc <cmd>Clear<cr>

@64-bitman 64-bitman force-pushed the textprop_overlay branch 3 times, most recently from 3b6a9b1 to 5526770 Compare March 13, 2026 03:52
@64-bitman 64-bitman force-pushed the textprop_overlay branch 8 times, most recently from 8e29531 to a60e2ff Compare March 13, 2026 07:54
@64-bitman 64-bitman force-pushed the textprop_overlay branch 2 times, most recently from fc7942c to ac3576d Compare March 14, 2026 01:21
@64-bitman
Copy link
Copy Markdown
Contributor Author

I will put this PR on hold until #19685 is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It would be better if vim's virtual text can overlay the actual text.

1 participant