Skip to content

Commit

Permalink
### V1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyruhl committed Jan 25, 2022
1 parent 50a536d commit 5c9722b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

# What's new in Intouch-Language

### V1.2.1

- bugfix trailing whitespace before ``-``

### V1.2.0

- Add folding between ``{region xxxx}`` and ``{endregion xxxx}``
Expand Down
10 changes: 6 additions & 4 deletions out/formats.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "intouch-language",
"displayName": "Intouch-Language and Formatter for VSCode. (c)2021 vitalyruhl",
"description": "Intouch-Language syntax highlighting, formatter and code snippets for VSCode",
"version": "1.2.0",
"version": "1.2.1",
"icon": "images/logo.png",
"publisher": "Vitaly-ruhl",
"engines": {
Expand Down
10 changes: 6 additions & 4 deletions src/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,20 @@ export function forFormat(text: string, config: any): string {
for (j in SINGLE_OPERATORS) {
if (text[i] === SINGLE_OPERATORS[j]) {
if (SINGLE_OPERATORS[j] === "-") {
if (text[i + 1] === " " || text[i + 1] === TAB) {
//23.01.2022 check '-' as single Operator, because it can be used in variables
//23.01.2022 check '-' as single Operator, because it can be used in variables
let tstSwp = text[i + 1] == " " && text[i - 1] != " "; // 2022.01.25 Bugfix
let tstNmb = text[i + 1] == " " && text[i - 1] != " " && isNaN(+text[i + 1]); // 2022.01.25 Bugfix
if (tstSwp) {
buf += " ";
}
} else if (text[i - 1] !== " ") {
} else if (text[i - 1] != " ") {
//check for space before operator
buf += " ";
}

buf += text[i];

if (text[i + 1] !== " ") {
if (text[i + 1] != " ") {
//check for space after operator
// let debug1 = SINGLE_OPERATORS[j];
// if (SINGLE_OPERATORS[j] === '+' || SINGLE_OPERATORS[j] === '-') {
Expand Down
2 changes: 1 addition & 1 deletion test/test.vbi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ITXStartAppInDirectory ( SYS_ToolsPath + "string ( with ) whitespaces test.", SY

{region check single operators}
SYS_Anlage = -1;{fixed 2021.10.29: no space on -/+ before Number!}
c=a+b +d- e+ f -g;{folowing comment not formated! -> c=a+b +d - e+ f;}
c=a+b +d- e+ f -g - x;{folowing comment not formated! -> c=a+b +d - e+ f;}
{# New Region trenner}
new12-issue-dashed-variable-123 = "this variable shal not be formated"
{endregion check single operators}
Expand Down

0 comments on commit 5c9722b

Please sign in to comment.