From 6f8d1fec3e719a91590563e42e4e3a5152b69ad5 Mon Sep 17 00:00:00 2001 From: Michael Bleuez Date: Wed, 9 Feb 2022 21:09:28 +0100 Subject: [PATCH] fix mutliline for api & nvim notify and they now respect the no_output_wrap config --- src/display.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/display.rs b/src/display.rs index 1be21209..8fbee968 100644 --- a/src/display.rs +++ b/src/display.rs @@ -92,11 +92,11 @@ pub fn display_nvim_notify( let res = match message { Ok(result) => nvim.lock().unwrap().command(&format!( "lua require\"sniprun.display\".display_nvim_notify(\"{}\", true)", - no_output_wrap(result, data, &DisplayType::Terminal), + no_output_wrap(result, data, &DisplayType::NvimNotify).replace("\n", "\\\n"), )), Err(result) => nvim.lock().unwrap().command(&format!( "lua require\"sniprun.display\".display_nvim_notify(\"{}\", false)", - no_output_wrap(&result.to_string(), data, &DisplayType::Terminal), + no_output_wrap(&result.to_string(), data, &DisplayType::NvimNotify).replace("\n", "\\\n"), )), }; info!("display notify res = {:?}", res); @@ -112,14 +112,14 @@ pub fn send_api( let mut nvim_instance = nvim.lock().unwrap(); nvim_instance.command(&format!( "lua require\"sniprun.display\".send_api(\"{}\", true)", - no_output_wrap(result, data, &DisplayType::Terminal), + no_output_wrap(result, data, &DisplayType::Api).replace("\n", "\\\n"), )) } Err(result) => { let mut nvim_instance = nvim.lock().unwrap(); nvim_instance.command(&format!( "lua require\"sniprun.display\".send_api(\"{}\", false)", - no_output_wrap(&result.to_string(), data, &DisplayType::Terminal), + no_output_wrap(&result.to_string(), data, &DisplayType::Api).replace("\n", "\\\n"), )) } };