Deleting all the characters in visual mode doesn't remove the virtual text

7 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Aug 1, 2022, 2:17:16 PM8/1/22
to vim_dev
Hi,

When deleting all the characters in a line with virtual text at the
end, the virtual
text is not removed. Instead the virtual text is attached to the next line:

------------------------------------------------------------------------------------
new
call setline(1, ["one", "two"])
call prop_type_add("MyProp", #{bufnr: bufnr(), highlight: 'Search'})
call prop_add(1, 0, #{type: "MyProp", text: "test", length: 4})
normal v$x
------------------------------------------------------------------------------------

After sourcing the above script, I expected the buffer to contain only
the line "two" but it has "two" followed by the virtual text "test".

- Yegappan

Bram Moolenaar

unread,
Aug 1, 2022, 4:19:23 PM8/1/22
to vim...@googlegroups.com, Yegappan Lakshmanan
It's not Visual mode, using "D" does the same.

--
hundred-and-one symptoms of being an internet addict:
222. You send more than 20 personal e-mails a day.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages