mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 16:58:17 +00:00
main: Move term:// protocol name to a macros
This commit is contained in:
@@ -317,14 +317,16 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// open terminals when opening files that start with term://
|
// 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( "
|
":call termopen( "
|
||||||
// Capture the command string
|
// Capture the command string
|
||||||
"matchstr(expand(\"<amatch>\"), "
|
"matchstr(expand(\"<amatch>\"), "
|
||||||
"'\\c\\mterm://\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
|
"'\\c\\m" PROTO "\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
|
||||||
// capture the working directory
|
// capture the working directory
|
||||||
"{'cwd': get(matchlist(expand(\"<amatch>\"), "
|
"{'cwd': get(matchlist(expand(\"<amatch>\"), "
|
||||||
"'\\c\\mterm://\\(.\\{-}\\)//'), 1, '')})");
|
"'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})");
|
||||||
|
#undef PROTO
|
||||||
|
|
||||||
/* Execute --cmd arguments. */
|
/* Execute --cmd arguments. */
|
||||||
exe_pre_commands(¶ms);
|
exe_pre_commands(¶ms);
|
||||||
|
Reference in New Issue
Block a user