aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-10-13 00:13:39 +0200
committerGitHub <noreply@github.com>2016-10-13 00:13:39 +0200
commit51937e1322de0e4348c217947c117f54f3c664c3 (patch)
tree65be4944976933d8c096cff724c10636b7c102b2 /src/nvim/main.c
parente9fd1244b799ab4fc79cc734e780aceaa79c4a04 (diff)
parent6b7faf22f4c2a7cdfeae5a8bd72674252a7740d7 (diff)
downloadrneovim-51937e1322de0e4348c217947c117f54f3c664c3.tar.gz
rneovim-51937e1322de0e4348c217947c117f54f3c664c3.tar.bz2
rneovim-51937e1322de0e4348c217947c117f54f3c664c3.zip
Merge #5470 from justinmk/pr5445
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 005f4dcc77..793babd4e5 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -320,14 +320,18 @@ int main(int argc, char **argv)
// open terminals when opening files that start with term://
#define PROTO "term://"
+ do_cmdline_cmd("augroup nvim_terminal");
+ do_cmdline_cmd("autocmd!");
do_cmdline_cmd("autocmd BufReadCmd " PROTO "* nested "
- ":call termopen( "
+ ":if !exists('b:term_title')|call termopen( "
// Capture the command string
"matchstr(expand(\"<amatch>\"), "
"'\\c\\m" PROTO "\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
// capture the working directory
"{'cwd': get(matchlist(expand(\"<amatch>\"), "
- "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})");
+ "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})"
+ "|endif");
+ do_cmdline_cmd("augroup END");
#undef PROTO
/* Execute --cmd arguments. */