diff --git a/README.md b/README.md index 0bbfea6..809cf5e 100644 --- a/README.md +++ b/README.md @@ -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: ``` diff --git a/package.json b/package.json index abee212..8b45075 100644 --- a/package.json +++ b/package.json @@ -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." } } } @@ -126,4 +131,4 @@ "dependencies": { "@vscode/test-web": "^0.0.8" } -} +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index bcd0151..7406606 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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 }