Patch 8.2.2014
Problem: Using CTRL-O in a prompt buffer moves cursor to start of the line.
Solution: Do not move the cursor when restarting edit. (closes #7330)
Files: src/job.c, src/testdir/test_prompt_buffer.vim
*** ../vim-8.2.2013/src/job.c 2020-10-17 18:51:48.501219339 +0200
--- src/job.c 2020-11-19 18:44:07.982201107 +0100
***************
*** 1628,1634 ****
if (cmdchar_todo == 'A')
coladvance((colnr_T)MAXCOL);
! if (cmdchar_todo == 'I' || curwin->w_cursor.col <= (int)STRLEN(prompt))
curwin->w_cursor.col = (int)STRLEN(prompt);
// Make sure the cursor is in a valid position.
check_cursor();
--- 1628,1634 ----
if (cmdchar_todo == 'A')
coladvance((colnr_T)MAXCOL);
! if (curwin->w_cursor.col < (int)STRLEN(prompt))
curwin->w_cursor.col = (int)STRLEN(prompt);
// Make sure the cursor is in a valid position.
check_cursor();
*** ../vim-8.2.2013/src/testdir/test_prompt_buffer.vim 2020-11-11 20:52:36.970181354 +0100
--- src/testdir/test_prompt_buffer.vim 2020-11-19 18:41:48.438623477 +0100
***************
*** 85,93 ****
call term_sendkeys(buf, left . left . left . bs . '-')
call WaitForAssert({-> assert_equal('cmd: -hel', term_getline(buf, 1))})
let end = "\<End>"
call term_sendkeys(buf, end . "x")
! call WaitForAssert({-> assert_equal('cmd: -helx', term_getline(buf, 1))})
call term_sendkeys(buf, "\<C-U>exit\<CR>")
call WaitForAssert({-> assert_equal('other buffer', term_getline(buf, 1))})
--- 85,96 ----
call term_sendkeys(buf, left . left . left . bs . '-')
call WaitForAssert({-> assert_equal('cmd: -hel', term_getline(buf, 1))})
+ call term_sendkeys(buf, "\<C-O>lz")
+ call WaitForAssert({-> assert_equal('cmd: -hzel', term_getline(buf, 1))})
+
let end = "\<End>"
call term_sendkeys(buf, end . "x")
! call WaitForAssert({-> assert_equal('cmd: -hzelx', term_getline(buf, 1))})
call term_sendkeys(buf, "\<C-U>exit\<CR>")
call WaitForAssert({-> assert_equal('other buffer', term_getline(buf, 1))})
*** ../vim-8.2.2013/src/version.c 2020-11-18 17:38:59.349902386 +0100
--- src/version.c 2020-11-19 18:46:05.465840131 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2014,
/**/
--
In his lifetime van Gogh painted 486 oil paintings. Oddly enough, 8975
of them are to be found in the United States.
/// 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 ///