To: vim_dev@googlegroups.com Subject: Patch 9.0.0815 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0815 Problem: ":!" does not switch to the alternate screen. Solution: For ":!" don't clear the previous command. (closes #11420, closes #11409) Files: runtime/doc/various.txt, src/ex_cmds.c, src/testdir/test_shell.vim *** /tmp/YCw9JL/src/ex_cmds.c 2022-11-01 11:51:39.546457195 +0000 --- /tmp/U0dNWL/src/ex_cmds.c 2022-11-01 11:51:39.546457195 +0000 *************** *** 929,934 **** --- 929,936 ---- STRCAT(t, newcmd); if (ins_prevcmd) STRCAT(t, prevcmd); + else + vim_free(t); p = t + STRLEN(t); STRCAT(t, trailarg); vim_free(newcmd); *************** *** 957,973 **** } } while (trailarg != NULL); ! // Don't do anything if there is no command as there isn't really anything ! // useful in running "sh -c ''". Avoids changing "prevcmd". ! if (STRLEN(newcmd) == 0) { ! vim_free(newcmd); ! return; } - vim_free(prevcmd); - prevcmd = newcmd; - if (bangredo) // put cmd in redo buffer for ! command { // If % or # appears in the command, it must have been escaped. --- 959,971 ---- } } while (trailarg != NULL); ! // Don't clear "prevcmd" if there is no command to run. ! if (STRLEN(newcmd) > 0) { ! vim_free(prevcmd); ! prevcmd = newcmd; } if (bangredo) // put cmd in redo buffer for ! command { // If % or # appears in the command, it must have been escaped. *** /tmp/MGDCQP/src/testdir/test_shell.vim 2022-11-01 11:51:39.554457195 +0000 --- /tmp/wmx8QP/src/testdir/test_shell.vim 2022-11-01 11:51:39.554457195 +0000 *************** *** 268,275 **** call assert_equal(['Cmd: [-c echo coconut]'], readfile('Xlog')) call writefile(['empty'], 'Xlog') ! call feedkeys(":!\", 'xt') " :! is a no-op ! call assert_equal(['empty'], readfile('Xlog')) call feedkeys(":!!\", 'xt') " :! doesn't clear previous command call assert_equal(['Cmd: [-c echo coconut]'], readfile('Xlog')) --- 268,275 ---- call assert_equal(['Cmd: [-c echo coconut]'], readfile('Xlog')) call writefile(['empty'], 'Xlog') ! call feedkeys(":!\", 'xt') " :! ! call assert_equal(['Cmd: [-c ]'], readfile('Xlog')) call feedkeys(":!!\", 'xt') " :! doesn't clear previous command call assert_equal(['Cmd: [-c echo coconut]'], readfile('Xlog')) *** /tmp/SvUMfP/src/version.c 2022-11-01 11:51:39.562457190 +0000 --- /tmp/k2vteP/src/version.c 2022-11-01 11:51:39.562457190 +0000 *************** *** 696,701 **** --- 696,703 ---- static int included_patches[] = { /* Add new patch number below this line */ /**/ + 815, + /**/ 814, /**/ 813,