# Release shell1.0.16 ## Notes in en-US ### Changes in this version - Package version bumped from `1.0.15` to `1.0.16`. - **Fix** ([#39](https://github.com/Tooark/vscode-ark-format/issues/39)): two defects in the script from the issue shifted the indentation, and they cancelled each other out, which is why the end of the file looked right again: - `${#var}` at the end of a line, such as `CURSOR=${#BUFFER}`, was read as `{` followed by a comment, so it opened a block and everything after it gained one level. An inline comment is now only recognized when there is whitespace before the `#`; `f() { # comment` still opens a block. - `end-of-line` in a `for ... in \` list was read as the tcsh `end` keyword and closed a block. Keywords were detected with the regex `\b`, which treats `-`, `=` and `.` as the end of a word. - **Fix**: keywords are now delimited as shell words, which only end at whitespace or at a metacharacter (`;&|()<>`). This covers every block keyword (`if`, `elif`, `else`, `fi`, `then`, `do`, `done`, `case`, `in`, `esac`, and the tcsh `while`, `foreach`, `end`, `endif`, `switch`, `endsw`, `breaksw`). The same defect affected much more common code: - `end=5`, `done=1`, `done-task`, `fi-tool`, `else-x` and `end.sh` closed a block. - `echo foo-then`, `echo foo-do`, `to-do`, `while-x`, `switch-user` and `case-x in` opened a block. - Unspaced input that the spacing rules fix afterwards is still recognized: `if[ -f a ];then`, `for x in a b;do`, `done`). Isso vale para todas as palavras-chave de bloco (`if`, `elif`, `else`, `fi`, `then`, `do`, `done`, `case`, `in`, `esac`, e as do tcsh `while`, `foreach`, `end`, `endif`, `switch`, `endsw`, `breaksw`). O mesmo defeito atingia código bem mais comum: - `end=5`, `done=1`, `done-task`, `fi-tool`, `else-x` e `end.sh` fechavam um bloco. - `echo foo-then`, `echo foo-do`, `to-do`, `while-x`, `switch-user` e `case-x in` abriam um bloco. - Entrada sem espaços, que as regras de espaçamento corrigem em seguida, continua reconhecida: `if[ -f a ];then`, `for x in a b;do`, `done