[vim/vim] Undo/redo can fail for virtual text properties. (Issue #19680)

3 views
Skip to first unread message

Paul Ollis

unread,
Mar 14, 2026, 11:02:19 AMMar 14
to vim/vim, Subscribed
paul-ollis created an issue (vim/vim#19680)

Steps to reproduce

One problem is shown by this vim script.

vim9script
setline(1, ['Line 1', 'Line 2', 'Line 3'])

prop_type_add('a', {highlight: 'DiffAdd'})
prop_type_add('b', {highlight: 'DiffChange'})

# Show <vtext-a> within line 1.
prop_add(1, 5, {type: 'a', text: '<vtext-a>'})

# Add text to the end of line 1.
set undolevels&
exe "normal 1GA, extended\<ESC>"

# Remove the property from line 1. Then add <surprise!> to line 3,
# using the other property type.
prop_remove({type: 'a'}, 1)
prop_add(3, 5, {type: 'b', text: '<surprise!>'})

# Undo the recent change to line 1 and the property text is now <surprise!>.
undo

Expected behaviour

The first line should look like:

Line 1<vtext-a> 1

but actually looks like:

Line 1<surprise> 1

Version of Vim

9.2.112

Environment

OS = LinuxMint 21.1
terminal = Terminator /
$TERM = xterm-256color
shell = Xonsh / Bash

Logs and stack traces


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

Christian Brabandt

unread,
4:51 PM (5 hours ago) 4:51 PM
to vim/vim, Subscribed

Closed #19680 as completed via ff41e9d.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19680/issue_event/24273309402@github.com>

Reply all
Reply to author
Forward
0 new messages