aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2015-06-02 21:55:33 -0300
committerJustin M. Keyes <justinkz@gmail.com>2015-06-14 13:59:01 -0400
commit34fdb11e53496b02d3af78156efcbbee07a4352c (patch)
tree9672a83da7ab0d4bcee495b25e53158e0ee8be99
parent8992f8b1c7388f4a30315d647244f00f09861ec7 (diff)
downloadrneovim-34fdb11e53496b02d3af78156efcbbee07a4352c.tar.gz
rneovim-34fdb11e53496b02d3af78156efcbbee07a4352c.tar.bz2
rneovim-34fdb11e53496b02d3af78156efcbbee07a4352c.zip
ex_docmd.c: :edit is a no-op in terminal buffers #2822
Closes #2779
-rw-r--r--src/nvim/ex_docmd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index b55b59453f..2ca2c59b24 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6565,11 +6565,13 @@ do_exedit (
(void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
old_curwin == NULL ? curwin : NULL);
- } else if ((eap->cmdidx != CMD_split
- && eap->cmdidx != CMD_vsplit
- )
- || *eap->arg != NUL
- ) {
+ } 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())