From: Foxe Chen Date: Wed, 25 Mar 2026 21:30:59 +0000 (+0000) Subject: patch 9.2.0249: clipboard: provider reacts to autoselect feature X-Git-Tag: v9.2.0249^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bde58322168a587fc966117f59198de6771ac672;p=thirdparty%2Fvim.git patch 9.2.0249: clipboard: provider reacts to autoselect feature Problem: clipboard: provider reacts to autoselect feature Solution: Disable autoselection when using clipboard provider feature (Foxe Chen). closes: #19812 Signed-off-by: Foxe Chen Signed-off-by: Christian Brabandt --- diff --git a/src/clipboard.c b/src/clipboard.c index 0786f29cc0..e869ae63e9 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -452,6 +452,10 @@ clip_auto_select(void) int clip_isautosel_star(void) { +# ifdef FEAT_CLIPBOARD_PROVIDER + if (clipmethod == CLIPMETHOD_PROVIDER) + return false; +# endif # ifdef FEAT_GUI if (gui.in_use) return vim_strchr(p_go, GO_ASEL) != NULL @@ -467,6 +471,10 @@ clip_isautosel_star(void) int clip_isautosel_plus(void) { +# ifdef FEAT_CLIPBOARD_PROVIDER + if (clipmethod == CLIPMETHOD_PROVIDER) + return false; +# endif # ifdef FEAT_GUI if (gui.in_use) return vim_strchr(p_go, GO_ASELPLUS) != NULL; diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim index e43bd601bb..3ae3b90e4a 100644 --- a/src/testdir/test_eval_stuff.vim +++ b/src/testdir/test_eval_stuff.vim @@ -1223,7 +1223,7 @@ func Test_clipboard_provider_redir_execute() endfunc " Test if clipboard provider feature respects the "unnamed" and "unnamedplus" -" values in the 'clipboard' option +" values in the 'clipboard' option, and ignores the "autoselect" value. func Test_clipboard_provider_clipboard_option() CheckFeature clipboard_provider @@ -1273,6 +1273,19 @@ func Test_clipboard_provider_clipboard_option() call assert_equal(["testing"], g:vim_copy.lines) call assert_equal(["testing"], g:vim_copy.lines) + if has('clipboard') + " Test that autoselect option is ignored, this can happen when visual + " selection ends and there is TextYankPost autocmd + set clipboard=autoselect + let g:autoselect_test = 1 + au TextYankPost * let g:autoselect_test = 0 + + call setline(1, "Hello world!") + call cursor(1, 0) + call feedkeys("vww\", "x!") + call assert_equal(1, g:autoselect_test) + endif + " Change and delete operations are tested in " Test_clipboard_provider_accessed_once() bw! @@ -1290,5 +1303,4 @@ func Test_clipboard_provider_clipboard_option() set clipboard& endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index c24a1dd178..f25d3cbb69 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 249, /**/ 248, /**/