From 5cee65780fe8306590c3cae96d3f0e1033def2dc Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Fri, 24 Jun 2016 00:13:47 +0200 Subject: [PATCH] Changed rustfmt beautifier to use context.filePath --- src/beautifiers/rustfmt.coffee | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/beautifiers/rustfmt.coffee b/src/beautifiers/rustfmt.coffee index 3661cb1..88f3ad5 100644 --- a/src/beautifiers/rustfmt.coffee +++ b/src/beautifiers/rustfmt.coffee @@ -15,11 +15,8 @@ module.exports = class Rustfmt extends Beautifier Rust: true } - beautify: (text, language, options) -> - editor = atom.workspace.getActivePaneItem() - buffer = editor.getBuffer?() - filePath = buffer.getPath?() - cwd = if filePath then path.dirname filePath else undefined + beautify: (text, language, options, context) -> + cwd = context.filePath and path.dirname context.filePath program = options.rustfmt_path or "rustfmt" help = { link: "https://github.com/nrc/rustfmt"