Editor Not Auto-Revealing After AI Edits

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor Bug Report: Editor Not Auto-Revealing After AI Edits

Problem Summary

When AI (Composer) edits a file, the editor does not automatically reveal/show the modified file. The file must be manually opened using Ctrl+P or clicking from the explorer.

Root Cause

InlineDiffService#addLine: line contains newline characters, which is not supported

This error is the direct cause of ERR no diff result available.

Error Details

Primary Errors

  1. ERR no diff result available

    • Frequency: High (occurs every time a file is modified)
    • Stack trace: Ass.computeDiff in workbench.desktop.main.js
    • Location: workbench.desktop.main.js:432:16248, workbench.desktop.main.js:435:11207
  2. InlineDiffService#addLine: line contains newline characters, which is not supported

    • Frequency: High (occurs simultaneously with no diff result available)
    • Location: workbench.desktop.main.js:663
    • This is the root cause

Additional Errors

  • [composer] Error in getPopulatedContext: EntryNotFound - Reference to non-existent file
  • [composer] No first token received within Xs - AI communication delay

Environment

  • Cursor Version: 2.3.35 (user setup)
  • VSCode Version: 1.105.1
  • OS: Windows_NT x64 10.0.26200
  • Project: Not a Git repository
  • Electron: 37.7.0
  • Node.js: 22.20.0

Attempted Solutions (All Failed)

  1. :white_check_mark: Changed settings (workbench.editor.*, cursor.chat.*, etc.)
  2. :white_check_mark: Restarted Cursor multiple times
  3. :white_check_mark: Checked cache folders
  4. :white_check_mark: Created missing path folders
  5. :white_check_mark: Verified using latest version (2.3.35)

Conclusion

This is a Cursor bug. It cannot be resolved through settings.

Cursor’s diff computation feature (InlineDiffService) cannot properly handle lines containing newline characters, causing diff computation to fail and preventing the editor from auto-revealing files.

Steps to Reproduce

  1. Open Developer Tools (Ctrl+Shift+P → “Toggle Developer Tools”)
  2. Go to Console tab
  3. Ask AI to modify a file (e.g., @file.py change one line)
  4. Observe errors in console:
    • ERR no diff result available
    • InlineDiffService#addLine: line contains newline characters, which is not supported
  5. Notice that the file does not automatically open in the editor

Expected Behavior

When AI modifies a file, it should automatically open/reveal in the editor.

Actual Behavior

The file does not automatically open. User must manually open it using Ctrl+P or clicking from explorer.

Console Output Example

ERR no diff result available: Error: no diff result available
    at Ass.computeDiff (workbench.desktop.main.js:432:16248)
    at workbench.desktop.main.js:435:11207

workbench.desktop.main.js:663 InlineDiffService#addLine: line contains newline characters, which is not supported

Workaround

  • Use Ctrl+P to manually open files after AI edits
  • Or click files from the explorer sidebar

Related Issues

This appears to be related to the existing issue: Cursor diff not clearing after commit

However, this report focuses on the auto-reveal functionality and the specific InlineDiffService error with newline characters.

Steps to Reproduce

Attempted Solutions (All Failed)

  1. :white_check_mark: Changed settings (workbench.editor.*, cursor.chat.*, etc.)
  2. :white_check_mark: Restarted Cursor multiple times
  3. :white_check_mark: Checked cache folders
  4. :white_check_mark: Created missing path folders
  5. :white_check_mark: Verified using latest version (2.3.35)

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Environment

  • Cursor Version: 2.3.35 (user setup)
  • VSCode Version: 1.105.1
  • OS: Windows_NT x64 10.0.26200
  • Project: Not a Git repository
  • Electron: 37.7.0
  • Node.js: 22.20.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report and the console logs.

The InlineDiffService#addLine: line contains newline characters error looks like a bug in diff handling. A few quick questions so I can pass this to the engineers:

  1. Which files are you editing? (language, encoding like UTF-8, Windows-1251, etc.)
  2. Does this reproduce in a Git repo, or only in projects without Git?
  3. Can you share an example file, or at least the file structure, where this happens?

Also, please check the line endings in the affected files. If they have mixed CRLF and LF, that could trigger the “newline characters” issue in the diff.

For now, the workaround is to open files via Ctrl+P, like you mentioned.

Thank you for your quick response! Here are the answers to your questions:

## Answers to Your Questions

### 1. Which files are you editing? (language, encoding)

**Language**: Python (`.py`)

**Encoding**: UTF-8 (without BOM)

**Line endings**: LF (`\n`)

Test files used:

- `Regular_Task/General/test.py`

- Many other Python files (all with the same configuration)

### 2. Does this reproduce in a Git repo, or only in projects without Git?

**Yes, this is a Git repository**.

```bash

$ git status

On branch master

Changes not staged for commit:

(use “git add …” to update what will be committed)

```

I initially reported that it was not a Git repository, which was incorrect. The project is managed with Git.

### 3. Can you share an example file, or at least the file structure?

**File structure**:

```

C:\Work\My_Project\

├── Regular_Task\

│ ├── General\

│ │ ├── test.py (test file)

│ │ ├── whf_start_mail.py

│ │ └── whf_end_mail.py

├── Project\

│ └── 20251222_Kaizen_MonthlyReport\

│ ├── src\

│ │ ├── generate_sr_trend_report.py

│ │ └── generate_ticket_report.py

│ └── tests\

│ └── test_l1l2_ticket_utilization_analyzer.py

└── .vscode\

└── settings.json

```

**Example file** (`test.py`):

```python

“”"

Editor auto-reveal test script

This file is used to test if the editor automatically reveals when changed.

“”"

def compute_average(values: list[float]) → float:

"""

Calculate the average of a list of numbers



Args:

    values: List of float numbers



Returns:

    Average value

"""

if not values:

    return 0.0

return sum(values) / len(values)

def main() → None:

"""Main function"""

print("=" \* 50)

print("🎯 Editor Auto-Reveal Test")

print("=" \* 50)

```

### 4. Line endings check

**Result**:

- `test.py`: CRLF: 0, LF: 66 (no mixed line endings, all LF)

- `.vscode/settings.json` has the following settings:

```json

“files.trimTrailingWhitespace”: true,

“files.insertFinalNewline”: true,

“files.trimFinalNewlines”: true,

```

**Line endings are consistent** - no CRLF/LF mixing. All files use LF (`\n`) consistently.

## Additional Information

### When the error occurs

- Every time AI modifies a file

- Not specific to certain files - occurs with all Python files

- Regardless of the size of the change (even a single-line change triggers the error)

### Settings Configuration

`.vscode/settings.json` (workspace settings):

```json

{

“workbench.editor.enablePreview”: false,

“workbench.editor.revealIfOpen”: true,

“workbench.editor.autoReveal”: true,

“explorer.autoReveal”: true,

“files.autoSave”: “afterDelay”,

“files.autoSaveDelay”: 1000

}

```

Global settings (`%APPDATA%\Cursor\User\settings.json`):

```json

{

“workbench.editor.enablePreview”: false,

“workbench.editor.revealIfOpen”: true,

“cursor.chat.autoApplyToFilesOutsideContext”: true,

“workbench.editor.autoReveal”: true,

“explorer.autoReveal”: true

}

```

These settings did not resolve the issue.

## Notes

The workaround (`Ctrl+P`) is functional, but having to manually open files every time significantly reduces work efficiency.

I hope this information helps the engineers identify and fix the issue. Thank you for your help!

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