mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-18 13:07:06 +04:00
Run formatter from Document directory (#12315)
Co-authored-by: Rob Gonnella <rob.gonnella@papayapay.com>
This commit is contained in:
parent
931dd9c1dc
commit
a83c23bb03
@ -774,7 +774,13 @@ pub fn format(&self) -> Option<BoxFuture<'static, Result<Transaction, FormatterE
|
||||
{
|
||||
use std::process::Stdio;
|
||||
let text = self.text().clone();
|
||||
|
||||
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
|
||||
.args(fmt_args)
|
||||
.stdin(Stdio::piped())
|
||||
|
Loading…
Reference in New Issue
Block a user