furynerd
furynerd

Reputation: 151

how to keep blank line-changes when auto format documents by vscode?

when coding, i prefer enter multiple line-changes to seperate and distinguish different code blocks. but when do auto format document in vscode, the line-changes alway being deleted.

is there any setting i can config to format without deleting these multiple line-changes?

i use vscode default formator and the language is cpp (sometimes shell/python)

Upvotes: 0

Views: 57

Answers (1)

starball
starball

Reputation: 51984

My original advice: The C/C++ extension supports clang-tidy and vcFormat by default. Depending on which one is being used, check if that tool has a setting that gets you what you want. Since the asker here is using vcFormat, I think all I can say is check out the settings that start with C_Cpp.vcFormat.space. in their IDs, and see if any of them help you get what you want. You might be fighting a losing battle though.

In this particular case, the asker was satisfied with the result of setting "C_Cpp.vcFormat.space.afterComma": true,.

Upvotes: 1

Related Questions