[vim/vim] GTK4: Support Vim specific formats for clipboard (PR #20445)

2 views
Skip to first unread message

Foxe Chen

unread,
Jun 7, 2026, 5:11:44 PM (2 days ago) Jun 7
to vim/vim, Subscribed

Currently the GTK4 GUI does not support Vim's internal specific formats that preserve motion type and encoding. It also doesn't support the 'html' option in 'clipboard'. This PR adds support for both.

A problem I came across is that GTK4 only supports conforming mime types in the clipboard. So the current naming of the formats ("_VIMENC_TEXT" & "_VIM_TEXT") do not work. To get around this I created a new set of formats called "application/x-vim-text" and "application/x-vim-enc-text", which do the same thing. The X11/GTK3/Wayland clipboard functionality also expose and use these formats as well in addition to the old format names. See // https://gitlab.gnome.org/GNOME/gtk/-/work_items/4087 and https://discourse.gnome.org/t/gtk4-clipboard-does-not-provide-contents-using-custom-mime-type-without-character/6858 for more info.

Another benefit is now clipboard data is only retrieved from the registers when a client requests it (on Wayland and X11). This makes the autoselect feature more efficient on the GTK4 GUI, since before it had to allocate a new string every time the visual selection changed.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20445

Commit Summary

  • 5769701 support vim formats for gtk4 gui

File Changes

(10 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20445@github.com>

Reply all
Reply to author
Forward
0 new messages