Patch 8.0.1816
Problem: No test for setcmdpos().
Solution: Add a test. (Dominique Pelle, closes #2901)
Files: src/testdir/test_cmdline.vim
*** ../vim-8.0.1815/src/testdir/test_cmdline.vim 2018-05-01
19:23:40.777975258 +0200
--- src/testdir/test_cmdline.vim 2018-05-12 13:15:47.948953255 +0200
***************
*** 470,473 ****
--- 470,494 ----
call delete('Xlog')
endfunc
+ func Test_setcmdpos()
+ func InsertTextAtPos(text, pos)
+ call assert_equal(0, setcmdpos(a:pos))
+ return a:text
+ endfunc
+
+ " setcmdpos() with position in the middle of the command line.
+ call feedkeys(":\"12\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt')
+ call assert_equal('"1ab2', @:)
+
+ call feedkeys(":\"12\<C-R>\<C-R>=InsertTextAtPos('a', 3)\<CR>b\<CR>", 'xt')
+ call assert_equal('"1b2a', @:)
+
+ " setcmdpos() with position beyond the end of the command line.
+ call feedkeys(":\"12\<C-B>\<C-R>=InsertTextAtPos('a', 10)\<CR>b\<CR>", 'xt')
+ call assert_equal('"12ab', @:)
+
+ " setcmdpos() returns 1 when not editing the command line.
+ call assert_equal(1, setcmdpos(3))
+ endfunc
+
set cpo&
*** ../vim-8.0.1815/src/version.c 2018-05-11 22:01:47.089458032 +0200
--- src/version.c 2018-05-12 13:18:34.876041188 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1816,
/**/
--
Save the plankton - eat a whale.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.