New Diff is shown between each line of the previewed code

Describe the Bug

What’s new is shown between each line of the previewed code

Steps to Reproduce

just ask Cursor

Expected Behavior

Normal code preview

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

版本: 0.44.8
提交: f3b5a63019e4e2283033b4db987a35f8413c7570
日期: 2024-12-22T05:48:08.427Z
浏览器: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cursor/0.44.8 Chrome/124.0.6367.243 Electron/30.5.1 Safari/537.36

Additional Information

nothing

Does this stop you from using Cursor

No - Cursor works, but with this issue

5 Likes

I’m getting the same thing since the 0.44.8 update. And yes – Cursor works but it is very difficult to effectively use it now because I can’t easily review actual changes.

Version: 0.44.8
VSCode Version: 1.93.1
Commit: f3b5a63019e4e2283033b4db987a35f8413c7570
Date: 2024-12-22T05:48:08.427Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

same bug here when i use composer agent, as @obliojoe said its hard to use it due to hard checking review on actual changes.

Version: 0.44.8
VSCode Version: 1.93.1
Commit: f3b5a63019e4e2283033b4db987a35f8413c7570
Date: 2024-12-22T05:48:08.427Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.26100

Hey, thanks for reporting!

I’ve passed this to the team to investigate.
Does this happen on every diff, even if you start a new chat / composer session?

yes it happened for every diff in new composer session as chat or agent mode.

1 Like

Got it, thanks!

I’ve passed this to the team already who are investigating!

4 Likes

any update for this, i really need hot fix for this diff

it is really getting harder working with composer @danperks

Hey,

Can anyone who faces this copy the raw output, and drop it here?
You can do this by pressing the “copy message” button that shows up at the bottom right of each message in the chat/composer!

This should help us figure out what’s going on here.

Thank you for following this topic even during the holidays

    private static instance: ParseService;
    private parser: Parser;
    private sourceCode: string = '';
    private oldTree: Parser.Tree;

     构造函数
    private constructor() {
        this.parser = new Parser();
        this.parser.setLanguage(Python);
        this.oldTree = this.parser.parse('');

The above is the output I got through the copy button, and the following is its screenshot

Thank you again for everything
:smiling_face_with_three_hearts:

Same issue. I wonder if it’s only a problem for Windows?

When viewing the raw message, everything looks fine. Could there be an issue with line ending normalizations?

Version: 0.44.9
VSCode Version: 1.93.1
Commit: 316e524257c2ea23b755332b0a72c50cf23e1b00
Date: 2024-12-26T21:58:59.149Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

I am having the same issue. Also on latest Windows 11.

Same issue, but I dont know how to reproduce it… I just thought it was “how it was”

Still the same issue on v0.44.11, is there any update on fixing this? It makes the chat diffs unusable. The diffs in the actual file are always correct without this issue.

I never used to have this issue, I think it started happening sometime after the agent mode update.

its been 2-3 weeks and still i have same issue. is there any update otherwise i will cancel my subscription, this is because its pointless to work with agent or chat without checking diffs @danperks

Hey, we are still working on this, it’s proving difficult to track down!

Are the Cursor devs able to replicate the issue (try Windows)? If not, perhaps provide users with a debug build of Cursor that will allow us to send detailed information when the issue occurs to try help track it down.

In the meantime as a quick fix, I wonder if you can force the chat diff display algorithm to completely ignore the parts which only consist of new lines/whitespace and no real modified characters.

1 Like

hey Dan, is there any possible update on 0.45 for this bug? And also i believe its kinda windows specific bug.

Hey, we’ve made a lot of improvements in 0.45, so it’s likely this has been resolved in that update.

Once you have it, do let me know if you see this issue again!

I updated to 0.45.3 and it’s still happening :frowning:

May I ask is there a way to safely reinstall Cursor and keep all my settings and data, to see if helps anything?

Are the devs not able to replicate this issue at all on a Windows machine?

Please try a temporary fix in the meantime. I’m not sure the backend implementation of the chat diff, but if it’s using Monaco Editor diff viewer, you are able to customize the diff algorithm to force new line/whitespace changes to be ignored.

I can also say the diff view inside the actual file is always correct, only issue is in chat diff view.

You can get this feature by customizing the diff algorithm.

Here is an example. The only change is 5 lines of code removed. I posted a screenshot of the scrollbar, you can see that is the only change indicated by the small red square (the gray thing is the inner scrollbar).

image


Version: 0.45.3
VSCode Version: 1.96.2
Commit: 92081828ae09de344d8673d063f4f5c55c81c9a0
Date: 2025-01-24T20:11:05.745Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

I opened the dev tools. I don’t know if this warning could be related:

Expanded warning:

(271) workbench.desktop.main.js:666 InlineDiffService#addLine: line contains newline characters, which is not supported
addLinesToDiff	@	workbench.desktop.main.js:666
addLinesToDiff	@	workbench.desktop.main.js:660
addLinesToDiff	@	workbench.desktop.main.js:2833
A	@	workbench.desktop.main.js:912
F	@	workbench.desktop.main.js:912
handleSlashEditResponseSingleDiffPure	@	workbench.desktop.main.js:914
streamResponse	@	workbench.desktop.main.js:590
(anonymous)	@	workbench.desktop.main.js:2823
await in (anonymous)		
(anonymous)	@	workbench.desktop.main.js:2823
runFastApplyOnCodeBlockInternal	@	workbench.desktop.main.js:2823
await in runFastApplyOnCodeBlockInternal		
(anonymous)	@	workbench.desktop.main.js:2823
j	@	workbench.desktop.main.js:60
(anonymous)	@	workbench.desktop.main.js:60
queue	@	workbench.desktop.main.js:60
(anonymous)	@	workbench.desktop.main.js:2823
j	@	workbench.desktop.main.js:60
(anonymous)	@	workbench.desktop.main.js:60
queue	@	workbench.desktop.main.js:60
runFastApplyOnCodeBlock	@	workbench.desktop.main.js:2823
finishStream	@	workbench.desktop.main.js:1982
await in finishStream		
finishStreamingTool	@	workbench.desktop.main.js:1984
toolWrappedStream	@	workbench.desktop.main.js:1984
await in toolWrappedStream		
L1	@	workbench.desktop.main.js:590
(anonymous)	@	workbench.desktop.main.js:989
handleStreamComposer	@	workbench.desktop.main.js:989
streamResponse	@	workbench.desktop.main.js:590
(anonymous)	@	workbench.desktop.main.js:2908
processCodeBlocks	@	workbench.desktop.main.js:2832
await in processCodeBlocks		
(anonymous)	@	workbench.desktop.main.js:2823
await in (anonymous)		
submitChatMaybeAbortCurrent	@	workbench.desktop.main.js:2823
await in submitChatMaybeAbortCurrent		
ut	@	workbench.desktop.main.js:2849
await in ut		
onSubmit	@	workbench.desktop.main.js:2849
O	@	workbench.desktop.main.js:2848
onSubmit	@	workbench.desktop.main.js:2848
handleSubmit	@	workbench.desktop.main.js:1040
(anonymous)	@	workbench.desktop.main.js:1042
gFi	@	workbench.desktop.main.js:455
(anonymous)	@	workbench.desktop.main.js:455
mFi	@	workbench.desktop.main.js:455
fk	@	workbench.desktop.main.js:455
update	@	workbench.desktop.main.js:450
gFi	@	workbench.desktop.main.js:455
xs	@	workbench.desktop.main.js:455
T2i	@	workbench.desktop.main.js:452
(anonymous)	@	workbench.desktop.main.js:452

(124) InlineDiffService#addLine: line contains newline characters, which is not supported
addLinesToDiff @ workbench.desktop.main.js:666
addLinesToDiff @ workbench.desktop.main.js:660
addLinesToDiff @ workbench.desktop.main.js:2833
A @ workbench.desktop.main.js:912
handleSlashEditResponseSingleDiffPure @ workbench.desktop.main.js:915
await in handleSlashEditResponseSingleDiffPure
streamResponse @ workbench.desktop.main.js:590
(anonymous) @ workbench.desktop.main.js:2823
await in (anonymous)
(anonymous) @ workbench.desktop.main.js:2823
runFastApplyOnCodeBlockInternal @ workbench.desktop.main.js:2823
await in runFastApplyOnCodeBlockInternal
(anonymous) @ workbench.desktop.main.js:2823
j @ workbench.desktop.main.js:60
(anonymous) @ workbench.desktop.main.js:60
queue @ workbench.desktop.main.js:60
(anonymous) @ workbench.desktop.main.js:2823
j @ workbench.desktop.main.js:60
(anonymous) @ workbench.desktop.main.js:60
queue @ workbench.desktop.main.js:60
runFastApplyOnCodeBlock @ workbench.desktop.main.js:2823
finishStream @ workbench.desktop.main.js:1982
await in finishStream
finishStreamingTool @ workbench.desktop.main.js:1984
toolWrappedStream @ workbench.desktop.main.js:1984
await in toolWrappedStream
L1 @ workbench.desktop.main.js:590
(anonymous) @ workbench.desktop.main.js:989
handleStreamComposer @ workbench.desktop.main.js:989
streamResponse @ workbench.desktop.main.js:590
(anonymous) @ workbench.desktop.main.js:2908
processCodeBlocks @ workbench.desktop.main.js:2832
await in processCodeBlocks
(anonymous) @ workbench.desktop.main.js:2823
await in (anonymous)
submitChatMaybeAbortCurrent @ workbench.desktop.main.js:2823
await in submitChatMaybeAbortCurrent
ut @ workbench.desktop.main.js:2849
await in ut
onSubmit @ workbench.desktop.main.js:2849
O @ workbench.desktop.main.js:2848
onSubmit @ workbench.desktop.main.js:2848
handleSubmit @ workbench.desktop.main.js:1040
(anonymous) @ workbench.desktop.main.js:1042
gFi @ workbench.desktop.main.js:455
(anonymous) @ workbench.desktop.main.js:455
mFi @ workbench.desktop.main.js:455
fk @ workbench.desktop.main.js:455
update @ workbench.desktop.main.js:450
gFi @ workbench.desktop.main.js:455
xs @ workbench.desktop.main.js:455
T2i @ workbench.desktop.main.js:452
(anonymous) @ workbench.desktop.main.js:452

Exported console logs (note that it repeats the warnings 272 and 124 times):
Forum doesn’t allow uploading text files. Here: Dropbox

I’m on 0.45.4