feat(ex_cmds): consistent :restart behavior (#36723)

This commit is contained in:
Olivia Kinnear
2025-11-30 05:14:28 -05:00
committed by GitHub
parent c87d92c3b4
commit 12d4c624bb
3 changed files with 26 additions and 22 deletions

View File

@@ -351,8 +351,8 @@ describe('TUI :restart', function()
restart_pid_check()
gui_running_check()
-- Check ":restart +qall" on an unmodified buffer.
tt.feed_data(':restart +qall\013')
-- Check ":restart +qall!" on an unmodified buffer.
tt.feed_data(':restart +qall!\013')
screen_expect(s0)
restart_pid_check()
gui_running_check()
@@ -397,8 +397,18 @@ describe('TUI :restart', function()
restart_pid_check()
gui_running_check()
-- Check ":restart" on the modified buffer.
-- Check ":confirm restart +echo" correctly ignores ":confirm"
tt.feed_data(':confirm restart +echo\013')
screen:expect({ any = vim.pesc('+cmd did not quit the server') })
-- Check ":restart" on a modified buffer.
tt.feed_data('ithis will be removed\027')
tt.feed_data(':restart\013')
screen:expect({ any = vim.pesc('Vim(qall):E37: No write since last change') })
-- Check ":restart +qall!" on a modified buffer.
tt.feed_data('ithis will be removed\027')
tt.feed_data(':restart +qall!\013')
screen_expect(s0)
restart_pid_check()
gui_running_check()
@@ -3979,7 +3989,7 @@ describe('TUI client', function()
-- Run :restart on the remote client.
-- The remote client should start a new server while the original one should exit.
feed_data(':restart\n')
feed_data(':restart +qall!\n')
screen_client:expect([[
^ |
{100:~ }|*3
@@ -4081,7 +4091,7 @@ describe('TUI client', function()
-- Run :restart on the client.
-- The client should start a new server while the original server should exit.
feed_data(':restart\n')
feed_data(':restart +qall!\n')
screen_client:expect([[
^ |
{100:~ }|*4