fix mutliline for api & nvim notify
and they now respect the no_output_wrap config
@@ -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"),
))
}
};
