Test coverage and headless nvim bug fixes

This commit is contained in:
Riz Ashraf committed 2026-09-27 08:10:09 +01:00
1 parent bffc8896f1
commit 4bae4e9c08
9 files changed
+316 -58

No files matched your search

+13
View File
@@ -21,6 +21,9 @@ pub async fn spawn_headless_nvim() -> Result<String, String> {
.arg("--headless")
.arg("--listen")
.arg(&socket_name)
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.kill_on_drop(true)
.spawn()
.map_err(|e| format!("Failed to spawn headless Neovim: {}", e))?;
@@ -40,3 +43,13 @@ pub async fn spawn_headless_nvim() -> Result<String, String> {
Ok(socket_name)
}
pub async fn kill_headless_nvim() {
let child_to_kill = {
let mut proc_lock = HEADLESS_PROC.lock().unwrap_or_else(|e| e.into_inner());
proc_lock.take()
};
if let Some(mut child) = child_to_kill {
let _ = child.kill().await;
}
}