Merge pull request #1135 from StevenIsaacs/uncrustify-config-path
Change path to uncrustify config file to be relative to the project rather than the open file.
This commit is contained in:
commit
243fa4167c
|
@ -38,16 +38,18 @@ 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)
|
||||
projectPath = atom.workspace.project.getPaths()[0]
|
||||
# console.log(basePath);
|
||||
configPath = path.resolve(basePath, configPath)
|
||||
# Expand Home Directory in Config Path
|
||||
expandedConfigPath = expandHomeDir(configPath)
|
||||
configPath = path.resolve(projectPath, expandedConfigPath)
|
||||
resolve configPath
|
||||
else
|
||||
reject(new Error("No Uncrustify Config Path set! Please configure Uncrustify with Atom Beautify."))
|
||||
)
|
||||
.then((configPath) =>
|
||||
|
||||
|
||||
# Select Uncrustify language
|
||||
lang = "C" # Default is C
|
||||
switch language
|
||||
|
|
Loading…
Reference in New Issue