Merge branch 'master' of https://github.com/Lawstorant/atom-beautify into Lawstorant-master
This commit is contained in:
commit
a9d3a0cce6
|
@ -1,4 +1,5 @@
|
|||
# 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.
|
||||
- Implement Verilog/SystemVerilog beautification via emacs verilog-mode
|
||||
- Add support for MagicPython grammar [#1851](https://github.com/Glavin001/atom-beautify/issues/1851)
|
||||
|
|
|
@ -24,10 +24,16 @@ module.exports = class BashBeautify extends Beautifier
|
|||
options: {
|
||||
Bash:
|
||||
indent_size: true
|
||||
use_tabs: true
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
beautysh = @exe("beautysh")
|
||||
file = @tempFile("input", text)
|
||||
beautysh.run([ '-i', options.indent_size, '-f', file ])
|
||||
.then(=> @readFile file)
|
||||
tabs = options.use_tabs
|
||||
if tabs is true
|
||||
beautysh.run([ '-t', '-f', file ])
|
||||
.then(=> @readFile file)
|
||||
else
|
||||
beautysh.run([ '-i', options.indent_size, '-f', file ])
|
||||
.then(=> @readFile file)
|
||||
|
|
|
@ -27,5 +27,9 @@ module.exports = {
|
|||
default: null
|
||||
minimum: 0
|
||||
description: "Indentation size/length"
|
||||
use_tabs:
|
||||
type: 'boolean'
|
||||
default: null
|
||||
description: "Use tabs for indentation"
|
||||
|
||||
}
|
||||
|
|
|
@ -145,6 +145,20 @@
|
|||
"name": "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": {
|
||||
"title": "Disable Beautifying Language",
|
||||
|
|
Loading…
Reference in New Issue