Trailing whitespaces in generated code

Have not found this topic so bring it up here.
Cursor tends to generate trailing whitespaces in its generated code, even if I instruction it to “avoid trailing whitespaces” in system prompts.

Any idea how to fix this issue? My system prompt is in Chinese, maybe someone has better prompts for this?

Or does Cursor support calling some extra tool to “trim white spaces” in generated code?

Thanks for any help!

1 Like

Same here.
(Wow, this is the exact reason why I made account for this forum.)

Hey, are you also using a Chinese prompt like the original poster?

I’ve not seen many reports of this, but you may be able to configure a format-on-save step that removes the whitespace, but doesn’t actually format the code, as a workaround.

Best way to test this is to run cursor --disable-extensions to turn all the linters off and use just Cursor’s raw AI features.