From 8ef41f590224dfeea2e51d9fec150e363fd72ee0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 19 Dec 2024 07:07:04 -0800 Subject: feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`. --- test/functional/ex_cmds/swapfile_preserve_recover_spec.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/functional/ex_cmds') diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index 2820cc9663..7234985009 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -115,7 +115,8 @@ describe("preserve and (R)ecover with custom 'directory'", function() t.skip(t.is_os('win')) local screen0 = Screen.new() local child_server = new_pipename() - fn.termopen({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--listen', child_server }, { + fn.jobstart({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--listen', child_server }, { + term = true, env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }, }) screen0:expect({ any = pesc('[No Name]') }) -- Wait for the child process to start. @@ -446,9 +447,10 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() end) it('(Q)uit at first file argument', function() - local chan = fn.termopen( + local chan = fn.jobstart( { nvim_prog, '-u', 'NONE', '-i', 'NONE', '--cmd', init_dir, '--cmd', init_set, testfile }, { + term = true, env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }, } ) @@ -468,7 +470,7 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() end) it('(A)bort at second file argument with -p', function() - local chan = fn.termopen({ + local chan = fn.jobstart({ nvim_prog, '-u', 'NONE', @@ -482,6 +484,7 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() otherfile, testfile, }, { + term = true, env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }, }) retry(nil, nil, function() @@ -508,7 +511,7 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() second %s /^ \zssecond$/ third %s /^ \zsthird$/]]):format(testfile, testfile, testfile) ) - local chan = fn.termopen({ + local chan = fn.jobstart({ nvim_prog, '-u', 'NONE', @@ -522,6 +525,7 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() 'set tags=' .. otherfile, '-tsecond', }, { + term = true, env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }, }) retry(nil, nil, function() -- cgit