Skip to content

Commit

Permalink
fix mutliline for api & nvim notify
Browse files Browse the repository at this point in the history
and they now respect the no_output_wrap config
  • Loading branch information
michaelb committed Feb 9, 2022
1 parent 1dd5629 commit 6f8d1fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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"),
))
}
};
Expand Down

0 comments on commit 6f8d1fe

Please sign in to comment.