Patch 8.2.1038

6 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 22, 2020, 2:31:11 PM6/22/20
to vim...@googlegroups.com

Patch 8.2.1038
Problem: Popupwin test fails.
Solution: Fix WaitForAssert() argument.
Files: src/testdir/test_popupwin.vim


diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim
index 627799c4931..ce4f0b68a5b 100644
--- a/src/testdir/test_registers.vim
+++ b/src/testdir/test_registers.vim
@@ -633,4 +633,22 @@ func Test_execute_reg_as_ex_cmd()
call assert_equal(repeat('abcdefghijklmnopqrstuvwxyz', 312), str)
endfunc

+" Test for clipboard registers with ASCII NUL
+func Test_clipboard_nul()
+ CheckFeature clipboard_working
+ new
+
+ " Test for putting ASCII NUL into the clipboard
+ set clipboard=unnamed
+ call append(0, "\ntest")
+ normal ggyyp
+ call assert_equal("^@test^@", strtrans(getreg('*')))
+ call assert_equal(getline(1), getline(2))
+ let b = split(execute(":reg *"), "\n")
+ call assert_match('"\*\s*\^@test\^J',b[1])
+
+ set clipboard&vim
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/winclip.c b/src/winclip.c
index 767bf1c71e0..db88e6787df 100644
--- a/src/winclip.c
+++ b/src/winclip.c
@@ -422,7 +422,7 @@ clip_mch_request_selection(Clipboard_T *cbd)
}
}

- if (str != NULL && *str != NUL)
+ if (str != NULL && metadata.txtlen != 0)
{
char_u *temp_clipboard;

@@ -543,7 +543,7 @@ clip_mch_set_selection(Clipboard_T *cbd)

if (lpszMem)
{
- vim_strncpy((char_u *)lpszMem, str, metadata.txtlen);
+ mch_memmove((char_u *)lpszMem, str, metadata.txtlen);
GlobalUnlock(hMem);
}
}

--
Dreams are free, but there's a small charge for alterations.

/// Bram Moolenaar -- Br...@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 ///

Christian Brabandt

unread,
Jun 22, 2020, 2:35:20 PM6/22/20
to vim...@googlegroups.com

On Mo, 22 Jun 2020, Bram Moolenaar wrote:

>
> Patch 8.2.1038
> Problem: Popupwin test fails.
> Solution: Fix WaitForAssert() argument.
> Files: src/testdir/test_popupwin.vim

The description talks about the previous patch, but this mail seemed to
be about 8.2.1039. The mail was also missing the change to version.c

Best,
Christian
--
Verwirrung ist die höchste Form der Kommunikation.
-- Salvatore Dali

Bram Moolenaar

unread,
Jun 22, 2020, 4:10:47 PM6/22/20
to vim...@googlegroups.com, Christian Brabandt

> On Mo, 22 Jun 2020, Bram Moolenaar wrote:
>
> >
> > Patch 8.2.1038
> > Problem: Popupwin test fails.
> > Solution: Fix WaitForAssert() argument.
> > Files: src/testdir/test_popupwin.vim
>
> The description talks about the previous patch, but this mail seemed to
> be about 8.2.1039. The mail was also missing the change to version.c

Try again:

Patch 8.2.1038
Problem: Popupwin test fails.
Solution: Fix WaitForAssert() argument.
Files: src/testdir/test_popupwin.vim


*** ../vim-8.2.1037/src/testdir/test_popupwin.vim 2020-06-22 19:24:18.807085225 +0200
--- src/testdir/test_popupwin.vim 2020-06-22 19:54:13.881668848 +0200
***************
*** 2454,2463 ****
call term_sendkeys(termbuf2, "exit\<CR>")

" Exiting shell closes popup window
- let pupwin = win_getid()
call feedkeys("exit\<CR>", 'xt')
" Wait for shell to exit
! call WaitForAssert({-> assert_notequal(pupwin, win_getid())})

call feedkeys(":quit\<CR>", 'xt')
call assert_equal(origwin, win_getid())
--- 2454,2462 ----
call term_sendkeys(termbuf2, "exit\<CR>")

" Exiting shell closes popup window
call feedkeys("exit\<CR>", 'xt')
" Wait for shell to exit
! call WaitForAssert({-> assert_equal("dead", job_status(term_getjob(termbuf)))})

call feedkeys(":quit\<CR>", 'xt')
call assert_equal(origwin, win_getid())
*** ../vim-8.2.1037/src/version.c 2020-06-22 19:38:59.928402805 +0200
--- src/version.c 2020-06-22 19:55:09.597502563 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1038,
/**/

--
To the optimist, the glass is half full.
To the pessimist, the glass is half empty.
To the engineer, the glass is twice as big as it needs to be.
Reply all
Reply to author
Forward
0 new messages