diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-10-09 16:00:12 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-10-12 21:37:08 +0200 |
commit | 6b7faf22f4c2a7cdfeae5a8bd72674252a7740d7 (patch) | |
tree | 3200dd0b3f164c51d451bc5901b17d6d71b59dfa /src/nvim/ex_cmds.c | |
parent | 538255c228acb59b6596011627abd2f6e0fa67d1 (diff) | |
download | rneovim-6b7faf22f4c2a7cdfeae5a8bd72674252a7740d7.tar.gz rneovim-6b7faf22f4c2a7cdfeae5a8bd72674252a7740d7.tar.bz2 rneovim-6b7faf22f4c2a7cdfeae5a8bd72674252a7740d7.zip |
main.c: "BufReadCmd term://": Skip existing terminal.
Check `exists('b:term_title')` to avoid the BufReadCmd for already-initialized
:terminal buffers.
Move the test for `:argadd`.
Add a test for `:edit<CR>`.
Tweak comments and code style.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 999375b147..6205daf0cb 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2116,14 +2116,12 @@ 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; + // Re-editing a terminal buffer: skip most buffer re-initialization. + if (!other_file && curbuf->terminal) { + check_arg_idx(curwin); // Needed when called from do_argfile(). + maketitle(); // Title may show the arg index, e.g. "(2 of 5)". + retval = OK; + goto theend; } /* |