From c45b860292635854b5ff595833afbafa2b680c15 Mon Sep 17 00:00:00 2001 From: Mathias Weber Date: Thu, 9 Jun 2016 16:02:38 +0200 Subject: [PATCH] fixed order of home-dir expansion and project resolution The uncrutify config path was first resolved against the current project folder. This would `expand-home-dir` to not expand the home folder. This patch should fix issues #747 and #818. --- src/beautifiers/uncrustify/index.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/beautifiers/uncrustify/index.coffee b/src/beautifiers/uncrustify/index.coffee index f60a522..c76acc7 100644 --- a/src/beautifiers/uncrustify/index.coffee +++ b/src/beautifiers/uncrustify/index.coffee @@ -37,6 +37,8 @@ module.exports = class Uncrustify extends Beautifier editor = atom.workspace.getActiveTextEditor() if editor? basePath = path.dirname(editor.getPath()) + # Expand Home Directory in Config Path + configPath = expandHomeDir(configPath) # console.log(basePath); configPath = path.resolve(basePath, configPath) resolve configPath @@ -45,9 +47,6 @@ module.exports = class Uncrustify extends Beautifier ) .then((configPath) => - # Expand Home Directory in Config Path - configPath = expandHomeDir(configPath) - # Select Uncrustify language lang = "C" # Default is C switch language