diff options
-rw-r--r-- | src/nvim/ex_cmds.c | 10 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 5 | ||||
-rw-r--r-- | test/functional/terminal/ex_terminal_spec.lua | 1 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 0226499e78..999375b147 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2116,6 +2116,16 @@ do_ecmd ( } } + // Make re-editing a terminal buffer a no-op + if (!other_file && curbuf->terminal != NULL) { + // this is needed for when we are called by do_argfile() and the new + // argument index becomes the terminal buffer we are already editing + check_arg_idx(curwin); + maketitle(); + retval = OK; + goto theend; + } + /* * if the file was changed we may not be allowed to abandon it * - if we are going to re-edit the same file diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 45407b7f12..828ef5f133 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6726,11 +6726,6 @@ do_exedit ( old_curwin == NULL ? curwin : NULL); } else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit) || *eap->arg != NUL) { - // ":edit <blank>" is a no-op in terminal buffers. #2822 - if (curbuf->terminal != NULL && eap->cmdidx == CMD_edit && *eap->arg == NUL) { - return; - } - /* Can't edit another file when "curbuf_lock" is set. Only ":edit" * can bring us here, others are stopped earlier. */ if (*eap->arg != NUL && curbuf_locked()) diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 09b4eaa8d5..46afd09594 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen') local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim local nvim_dir, source, eq = helpers.nvim_dir, helpers.source, helpers.eq local execute, eval = helpers.execute, helpers.eval +local funcs = helpers.funcs if helpers.pending_win32(pending) then return end |