nixos-config/modules/helix/format-filepath.patch

11 lines
488 B
Diff
Raw Normal View History

2024-09-29 06:04:17 +00:00
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -762,6 +762,7 @@ pub fn format(&self) -> Option<BoxFuture<'static, Result<Transaction, FormatterE
let text = self.text().clone();
let mut process = tokio::process::Command::new(&fmt_cmd);
process
+ .env("HX_FILE", self.path()?.to_str().unwrap_or(""))
.args(fmt_args)
.stdin(Stdio::piped())
.stdout(Stdio::piped())