mirror of https://github.com/helix-editor/helix
Run formatter from Document directory (#12315)
Co-authored-by: Rob Gonnella <rob.gonnella@papayapay.com>pull/12471/head
parent
931dd9c1dc
commit
a83c23bb03
|
@ -774,7 +774,13 @@ impl Document {
|
||||||
{
|
{
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
let text = self.text().clone();
|
let text = self.text().clone();
|
||||||
|
|
||||||
let mut process = tokio::process::Command::new(&fmt_cmd);
|
let mut process = tokio::process::Command::new(&fmt_cmd);
|
||||||
|
|
||||||
|
if let Some(doc_dir) = self.path.as_ref().and_then(|path| path.parent()) {
|
||||||
|
process.current_dir(doc_dir);
|
||||||
|
}
|
||||||
|
|
||||||
process
|
process
|
||||||
.args(fmt_args)
|
.args(fmt_args)
|
||||||
.stdin(Stdio::piped())
|
.stdin(Stdio::piped())
|
||||||
|
|
Loading…
Reference in New Issue