Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New behavior, now can customize the tabsizer #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ If error color is disabled, indent colors will be rendered until the length of r
"indentRainbow.colorOnWhiteSpaceOnly": true // false is the default
```

By default the tabsize is 4
```js
"indentRainbow.tabSize": 4 // 4 is the default
```

Build with:

```
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
"type": "boolean",
"default": false,
"description": "If error color is disabled, indent colors will be rendered until the length of rendered characters (white spaces, tabs, and other ones) is divisible by tabsize. Turn on this option to render white spaces and tabs only."
},
"indentRainbow.tabSize": {
"type": "integer",
"default": 4,
"description": "By default the tabsize is 4."
}
}
}
Expand Down Expand Up @@ -126,4 +131,4 @@
"dependencies": {
"@vscode/test-web": "^0.0.8"
}
}
}
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export function activate(context: vscode.ExtensionContext) {
}
var regEx = /^[\t ]+/gm;
var text = activeEditor.document.getText();
var tabSizeRaw = activeEditor.options.tabSize;
var tabSize = 4
var tabSizeRaw = vscode.workspace.getConfiguration('indentRainbow')['tabSize'] || activeEditor.options.tabSize;
var tabSize = vscode.workspace.getConfiguration('indentRainbow')['tabSize'] || 4;
if(tabSizeRaw !== 'auto') {
tabSize=+tabSizeRaw
}
Expand Down