diff --git a/scripts/vim_na_files.txt b/scripts/vim_na_files.txt index 08a6228817..b0b7d988ff 100644 --- a/scripts/vim_na_files.txt +++ b/scripts/vim_na_files.txt @@ -116,6 +116,7 @@ src/testdir/test_remote.vim src/testdir/test_restricted.vim src/testdir/test_short_sleep.py src/testdir/test_shortpathname.vim +src/testdir/test_suspend.vim src/testdir/test_tcl.vim src/testdir/test_termencoding.vim src/testdir/test_xdg.vim diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 49ffd6ed2c..ef971d3e8a 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5178,7 +5178,7 @@ static void nv_suspend(cmdarg_T *cap) if (VIsual_active) { end_visual_mode(); // stop Visual mode } - do_cmdline_cmd("st"); + do_cmdline_cmd("stop"); } /// "gv": Reselect the previous Visual area. If Visual already active, diff --git a/test/old/testdir/test_suspend.vim b/test/old/testdir/test_suspend.vim deleted file mode 100644 index aa6603be78..0000000000 --- a/test/old/testdir/test_suspend.vim +++ /dev/null @@ -1,63 +0,0 @@ -" Test :suspend - -source shared.vim -source term_util.vim - -func CheckSuspended(buf, fileExists) - call WaitForAssert({-> assert_match('[$#] $', term_getline(a:buf, '.'))}) - - if a:fileExists - call assert_equal(['foo'], readfile('Xfoo')) - else - " Without 'autowrite', buffer should not be written. - call assert_equal(0, filereadable('Xfoo')) - endif - - call term_sendkeys(a:buf, "fg\\") - call WaitForAssert({-> assert_equal(' 1 foo', term_getline(a:buf, '.'))}) -endfunc - -func Test_suspend() - if !has('terminal') || !executable('/bin/sh') - return - endif - - let buf = term_start('/bin/sh') - " Wait for shell prompt. - call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) - - call term_sendkeys(buf, GetVimCommandClean() - \ . " -X" - \ . " -c 'set nu'" - \ . " -c 'call setline(1, \"foo\")'" - \ . " Xfoo\") - " Cursor in terminal buffer should be on first line in spawned vim. - call WaitForAssert({-> assert_equal(' 1 foo', term_getline(buf, '.'))}) - - for suspend_cmd in [":suspend\", - \ ":stop\", - \ ":suspend!\", - \ ":stop!\", - \ "\"] - " Suspend and wait for shell prompt. - call term_sendkeys(buf, suspend_cmd) - call CheckSuspended(buf, 0) - endfor - - " Test that :suspend! with 'autowrite' writes content of buffers if modified. - call term_sendkeys(buf, ":set autowrite\") - call assert_equal(0, filereadable('Xfoo')) - call term_sendkeys(buf, ":suspend\") - " Wait for shell prompt. - call CheckSuspended(buf, 1) - - " Quit gracefully to dump coverage information. - call term_sendkeys(buf, ":qall!\") - call TermWait(buf) - " Wait until Vim actually exited and shell shows a prompt - call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) - call StopShellInTerminal(buf) - - exe buf . 'bwipe!' - call delete('Xfoo') -endfunc