Fix #2014. Improve Lua beautifier indentation
This commit is contained in:
parent
14b5d6c31e
commit
ae7372d89b
|
@ -11,13 +11,20 @@ module.exports = class Lua extends Beautifier
|
|||
link: "https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/lua-beautifier/beautifier.coffee"
|
||||
|
||||
options: {
|
||||
Lua: true
|
||||
Lua: {
|
||||
indent_size: true
|
||||
indent_char: true
|
||||
end_of_line: true
|
||||
}
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
options.eol = @getDefaultLineEnding('\r\n','\n',options.end_of_line)
|
||||
options.eol = @getDefaultLineEnding('\r\n','\n', options.end_of_line)
|
||||
indentChar = options.indent_char or " "
|
||||
indentSize = options.indent_size
|
||||
indent = indentChar.repeat(indentSize)
|
||||
new @Promise (resolve, reject) ->
|
||||
try
|
||||
resolve format text, options.indent_char.repeat(options.indent_size), @warn, options
|
||||
resolve(format(text, indent, @warn, options));
|
||||
catch error
|
||||
reject error
|
||||
|
|
Loading…
Reference in New Issue