mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
3320b99816
commit
36fb600a9e
@ -9497,12 +9497,14 @@ static void ex_folddo(exarg_T *eap)
|
|||||||
|
|
||||||
static void ex_terminal(exarg_T *eap)
|
static void ex_terminal(exarg_T *eap)
|
||||||
{
|
{
|
||||||
// We will call termopen() with ['shell'] if not given a {cmd}.
|
char *name = (char *)p_sh; // Default to 'shell' if {cmd} is not given.
|
||||||
char *name = (char *)p_sh;
|
bool mustfree = false;
|
||||||
char *lquote = "['";
|
char *lquote = "['";
|
||||||
char *rquote = "']";
|
char *rquote = "']";
|
||||||
|
|
||||||
if (*eap->arg != NUL) {
|
if (*eap->arg != NUL) {
|
||||||
name = (char *)vim_strsave_escaped(eap->arg, (char_u *)"\"\\");
|
name = (char *)vim_strsave_escaped(eap->arg, (char_u *)"\"\\");
|
||||||
|
mustfree = true;
|
||||||
lquote = rquote = "\"";
|
lquote = rquote = "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9512,7 +9514,7 @@ static void ex_terminal(exarg_T *eap)
|
|||||||
eap->forceit==TRUE ? "!" : "", lquote, name, rquote);
|
eap->forceit==TRUE ? "!" : "", lquote, name, rquote);
|
||||||
do_cmdline_cmd(ex_cmd);
|
do_cmdline_cmd(ex_cmd);
|
||||||
|
|
||||||
if (name != (char *)p_sh) {
|
if (mustfree) {
|
||||||
xfree(name);
|
xfree(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim
|
local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim
|
||||||
local nvim_dir, source = helpers.nvim_dir, helpers.source
|
local nvim_dir, source, ok = helpers.nvim_dir, helpers.source, helpers.ok
|
||||||
local execute = helpers.execute
|
local execute, eval = helpers.execute, helpers.eval
|
||||||
|
|
||||||
describe(':terminal', function()
|
describe(':terminal', function()
|
||||||
local screen
|
local screen
|
||||||
@ -53,5 +53,7 @@ describe(':terminal', function()
|
|||||||
source([[
|
source([[
|
||||||
autocmd BufNew * set shell=foo
|
autocmd BufNew * set shell=foo
|
||||||
terminal]])
|
terminal]])
|
||||||
|
-- Verify that BufNew actually fired (else the test is useless).
|
||||||
|
ok('foo' == eval('&shell'))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user