Changed rustfmt beautifier to use context.filePath

This commit is contained in:
Leonard Hecker 2016-06-24 00:13:47 +02:00
parent 458fdb62e2
commit 5cee65780f
1 changed files with 2 additions and 5 deletions

View File

@ -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"