[vim/vim] GVim does not lose selection ownership and does not use VisualNOS when it should (Issue #19914)

2 views
Skip to first unread message

依云

unread,
Apr 4, 2026, 8:15:56 AMApr 4
to vim/vim, Subscribed
lilydjwg created an issue (vim/vim#19914)

Steps to reproduce

  1. start GVim and set clipboard=autoselect
  2. select some text. Vim now owns the primary selection
  3. select some text in another application so that Vim no longer owns the selection
  4. Vim still uses Visual instead of VisualNOS, indicating it owns the selection but it doesn't actually. This leads me to expect wrong text when pasting.
  5. Also, in this should-be-VisualNOS mode, if I middle click to paste text into Vim, Vim regains the selection ownership and pastes Vim's selection despite no copy intention is expressed by the user.

Since 8b009a3. This bug made confused me several times in the past.

Expected behaviour

VisualNOS is properly used and no automatically regain ownership of selection.

Version of Vim

9.2.280

Environment

Arch Linux, GTK GUI on Wayfire Wayland compositor.

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

依云

unread,
Apr 4, 2026, 8:28:29 AMApr 4
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#19914)

I notice #19752 but it doesn't work for Wayland as gui_mch_get_display returns NULL for Wayland.


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/issues/19914/4187045306@github.com>

Shane Harper

unread,
7:34 AM (5 hours ago) 7:34 AM
to vim/vim, Subscribed
shaneharper left a comment (vim/vim#19914)

Should there be a separate issue for

  1. Also, in this should-be-VisualNOS mode, if I middle click to paste text into Vim, Vim regains the selection ownership and pastes Vim's selection despite no copy intention is expressed by the user.

?

(This happens when using X11 or Wayland.)


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/issues/19914/4312821621@github.com>

依云

unread,
8:43 AM (4 hours ago) 8:43 AM
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#19914)

Yes, I opened #20057 for it. (Primary selection is so easy to lose that I didn't think this is a bug in Vim before.)


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/issues/19914/4313226602@github.com>

Reply all
Reply to author
Forward
0 new messages