Cursor keeps using 2 tab size instead of 4 tab size while formating document

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m trying to format using shift-alt-f, However, auto-formatter keeps formatting it with 2 spaces instead of 4.
editor.tabSize is set to 4 in both user/workspace.

detect indentation is off in both user and workspace.

Any ideas?

Steps to Reproduce

Unknown. For some reason 2 spaces for tab formatting is being used instead of 4. THere is no indication what override the settings to format with 2 tab spaces.

Expected Behavior

I expect formatter to use 4 spaces indentation.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.45 (user setup)
VSCode Version: 1.99.3
Commit: 3ccce8f55d8cca49f6d28b491a844c699b8719a0
Date: 2025-09-22T18:22:38.013Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. Could you let me know which programming language you’re using and which extension you use for formatting? It’s possible your project has a code style config with specific rules.

Hey. I’m trying to format .cpp file.
I uninstalled all extensions, now I only have clangd extension installed for formatting cpp code.

Edit:
It looks like adding file .clang-format:
```
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
```
fixed the issue.

Likely editor.TabSize doesn’t set proper settings to clang formatter.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.