To: vim_dev@googlegroups.com Subject: Patch 8.2.0907 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0907 Problem: When using :global clipboard isn't set correctly. Solution: Set "clip_unnamed_saved" instead of "clip_unnamed". (Christian Brabandt, closes #6203, closes #6198) Files: src/clipboard.c, src/testdir/test_global.vim *** ../vim-8.2.0906/src/clipboard.c 2020-04-12 19:37:13.506297291 +0200 --- src/clipboard.c 2020-06-05 19:57:08.566776395 +0200 *************** *** 1317,1323 **** } if (errmsg == NULL) { ! clip_unnamed = new_unnamed; clip_autoselect_star = new_autoselect_star; clip_autoselect_plus = new_autoselect_plus; clip_autoselectml = new_autoselectml; --- 1317,1328 ---- } if (errmsg == NULL) { ! if (global_busy) ! // clip_unnamed will be reset to clip_unnamed_saved ! // at end_global_changes ! clip_unnamed_saved = new_unnamed; ! else ! clip_unnamed = new_unnamed; clip_autoselect_star = new_autoselect_star; clip_autoselect_plus = new_autoselect_plus; clip_autoselectml = new_autoselectml; *** ../vim-8.2.0906/src/testdir/test_global.vim 2020-03-22 14:08:27.321399669 +0100 --- src/testdir/test_global.vim 2020-06-05 20:00:38.534071463 +0200 *************** *** 1,3 **** --- 1,4 ---- + source check.vim func Test_yank_put_clipboard() new *************** *** 12,17 **** --- 13,28 ---- set clipboard& bwipe! endfunc + + func Test_global_set_clipboard() + CheckFeature clipboard_working + new + set clipboard=unnamedplus + let @+='clipboard' | g/^/set cb= | let @" = 'unnamed' | put + call assert_equal(['','unnamed'], getline(1, '$')) + set clipboard& + bwipe! + endfunc func Test_nested_global() new *** ../vim-8.2.0906/src/version.c 2020-06-05 19:36:53.468217572 +0200 --- src/version.c 2020-06-05 19:59:09.866529941 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 907, /**/ -- This is an airconditioned room, do not open Windows. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///