Describe the Bug
The code editing tools consistently introduce indentation errors that persist even after manual correction and git reverts. These errors appear as Python IndentationError exceptions that prevent module imports and code execution. The errors seem to accumulate over multiple edit operations and become increasingly difficult to resolve.
Steps to Reproduce
- Start with a working Python file, 500 lines or longer.
- Use the search_replace tool to make multiple edits to the file
- Attempt to import or execute the modified Python code
- Observe IndentationError exceptions like:
IndentationError: unindent does not match any outer indentation level - Critical: Even after manually fixing indentation errors or reverting to a prior git state, the errors persist
- The errors seem to compound - each subsequent edit operation introduces new indentation issues
Observed Symptoms:
- Immediate Errors: Import failures with IndentationError after edit operations
- Persistent State: Errors continue even after:
- Manual indentation fixes
- Git reverts to previous working commits
- Multiple correction attempts
- Cascading Failures: Initial indentation errors seem to create additional issues in subsequent edits
- Unpredictable Locations: Errors appear in various parts of the file, not just at edit sites
Impact:
- High: Prevents code execution and testing
- Blocks Development: Unable to verify fixes or run integration tests
- Accumulating Technical Debt: Each edit session makes the problem worse
- Workflow Disruption: Requires manual intervention to restore working state
Potential Root Causes:
- Mixed Whitespace: Edit tool may be mixing tabs and spaces
- Context Awareness: Tool may not be preserving surrounding indentation context
- Multi-line Edit Issues: Complex replacements may misalign indentation blocks
- State Persistence: Tool may be maintaining incorrect indentation state between operations
Workaround:
- Currently requiring manual correction of indentation after each edit operation, but even this is unreliable as errors seem to persist or reappear.
Expected Behavior
Files don’t manifest random indentation errors in places where they haven’t even been edited. Fresh indentation errors do not appear when reverting code to previously good state.
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.3.8 (user setup)
VSCode Version: 1.99.3
Commit: a1fa6fc7d2c2f520293aad84aaa38d091dee6fe0
Date: 2025-07-31T21:46:17.109Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100
Additional Information
The problem comes in waves. Sometimes it doesn’t happen for many hours. Sometimes it happens with every single change.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor