From febee7b85f030dfe6e08fa35728e6bec3202692b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDinesh?= <“reachtodinesh@gmail.com”> Date: Fri, 22 Jul 2022 07:10:19 +0530 Subject: [PATCH] fix: Add backslash when filepath contains spaces --- src/cmd_line.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cmd_line.rs b/src/cmd_line.rs index c91ac00..c350d79 100644 --- a/src/cmd_line.rs +++ b/src/cmd_line.rs @@ -170,7 +170,12 @@ pub fn handle_command_line_arguments(args: Vec) -> Result<(), String> { neovim_args.push("-p".to_owned()); } - neovim_args.extend::>(files_to_open); + neovim_args.extend::>( + files_to_open + .iter() + .map(|file| file.replace(" ", "\\ ")) + .collect(), + ); /* * Integrate Environment Variables as Defaults to the command-line ones.