summaryrefslogtreecommitdiff
path: root/test/normal/codepoint-width
diff options
context:
space:
mode:
authorSimon Fowler <simon.fowler@anu.edu.au>2019-06-20 11:19:39 +1000
committerSimon Fowler <simon.fowler@anu.edu.au>2019-06-20 13:19:15 +1000
commit04005b06b07d9415cca3e9407dae06f7b667d144 (patch)
treee879b3ba722c0855595cf82368f77c9428d9a427 /test/normal/codepoint-width
parent59e43c8f0c2d125952c8bad3b1b0c9053046926d (diff)
Add support for basic auto-indenting of sh code.
This attempts to support a simple formatting and intentation style for plain sh syntax (and other sh-compatible code which doesn't stray too far from portable sh). The complexity of sh syntax means that we have to be opinionated - attempting to be more flexible would require extensive context awareness, and would require something more akin to a proper autoformatting tool or a language server. The formatting style used here makes use of vertical whitespace as the primary delimiter, so that code ends up looking like this: if [ $foo = "bar" ]; then thing1 else thing2 fi for i in foo bar baz; do thing1 thing2 done case "$foo" in bar) thing1;; baz) thing1 thing2 ;; esac Since the formatting style used is very opinionated the 'sh_auto_indent' option can be used to disable auto-indentation, with the default set to 'no'.
Diffstat (limited to 'test/normal/codepoint-width')
0 files changed, 0 insertions, 0 deletions