Merge branch 'master' of https://github.com/Lawstorant/atom-beautify into Lawstorant-master

This commit is contained in:
Glavin Wiechert 2018-03-01 21:22:29 -04:00
commit a9d3a0cce6
4 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,5 @@
# Next # Next
- Add the option to indent Bash with tabs [#1951](https://github.com/Glavin001/atom-beautify/issues/1951)
- See [#1980](https://github.com/Glavin001/atom-beautify/pull/1980). Add VHDL beautifier and language support. - See [#1980](https://github.com/Glavin001/atom-beautify/pull/1980). Add VHDL beautifier and language support.
- Implement Verilog/SystemVerilog beautification via emacs verilog-mode - Implement Verilog/SystemVerilog beautification via emacs verilog-mode
- Add support for MagicPython grammar [#1851](https://github.com/Glavin001/atom-beautify/issues/1851) - Add support for MagicPython grammar [#1851](https://github.com/Glavin001/atom-beautify/issues/1851)

View File

@ -24,10 +24,16 @@ module.exports = class BashBeautify extends Beautifier
options: { options: {
Bash: Bash:
indent_size: true indent_size: true
use_tabs: true
} }
beautify: (text, language, options) -> beautify: (text, language, options) ->
beautysh = @exe("beautysh") beautysh = @exe("beautysh")
file = @tempFile("input", text) file = @tempFile("input", text)
beautysh.run([ '-i', options.indent_size, '-f', file ]) tabs = options.use_tabs
.then(=> @readFile file) if tabs is true
beautysh.run([ '-t', '-f', file ])
.then(=> @readFile file)
else
beautysh.run([ '-i', options.indent_size, '-f', file ])
.then(=> @readFile file)

View File

@ -27,5 +27,9 @@ module.exports = {
default: null default: null
minimum: 0 minimum: 0
description: "Indentation size/length" description: "Indentation size/length"
use_tabs:
type: 'boolean'
default: null
description: "Use tabs for indentation"
} }

View File

@ -145,6 +145,20 @@
"name": "Bash", "name": "Bash",
"namespace": "bash" "namespace": "bash"
} }
},
"use_tabs": {
"type": "boolean",
"default": null,
"description": "Use tabs instead of spaces for indentation, overrides `Indent Size` (Supported by beautysh)",
"title": "Indent with tabs",
"beautifiers": [
"beautysh"
],
"key": "use_tabs",
"language": {
"name": "Bash",
"namespace": "bash"
}
}, },
"disabled": { "disabled": {
"title": "Disable Beautifying Language", "title": "Disable Beautifying Language",