aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-02-28 06:29:38 +0300
committerZyX <kp-pav@yandex.ru>2016-02-28 06:29:38 +0300
commitc6eeefa339ee3452866ed5517b6e8a3decc1ec67 (patch)
tree2985c5bcf2f0d210522410670b437dac0f60481a
parentb32396170f2c1cd17f36b8a5eb1ad313f6f9a8c3 (diff)
downloadrneovim-c6eeefa339ee3452866ed5517b6e8a3decc1ec67.tar.gz
rneovim-c6eeefa339ee3452866ed5517b6e8a3decc1ec67.tar.bz2
rneovim-c6eeefa339ee3452866ed5517b6e8a3decc1ec67.zip
main: Move term:// protocol name to a macros
-rw-r--r--src/nvim/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 92e8774ec4..5b5c8a22aa 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -317,14 +317,16 @@ int main(int argc, char **argv)
}
// open terminals when opening files that start with term://
- do_cmdline_cmd("autocmd BufReadCmd term://* nested "
+#define PROTO "term://"
+ do_cmdline_cmd("autocmd BufReadCmd " PROTO "* nested "
":call termopen( "
// Capture the command string
"matchstr(expand(\"<amatch>\"), "
- "'\\c\\mterm://\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
+ "'\\c\\m" PROTO "\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
// capture the working directory
"{'cwd': get(matchlist(expand(\"<amatch>\"), "
- "'\\c\\mterm://\\(.\\{-}\\)//'), 1, '')})");
+ "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})");
+#undef PROTO
/* Execute --cmd arguments. */
exe_pre_commands(&params);