Setting to ignore whitespace-only lines
See original GitHub issueVS Code currently removes all trailing whitespace including on whitespace only lines.
Consider the following JavaScript/Typescript snippet:
export default class Example {
constructor() {
console.log("called constructor");
}
doSomething() {
console.log("I did something.");
}
}
When I come back to this file, I expect to be able to move the cursor between the two methods and add a new one in between without having to hit the tab key, but after running the VS Code formatter, the whitespace on that line (ln. 5) is removed.
Atom supports this under an “Ignore Whitespace Only Lines” setting.
Additionally, there’s a VS Code extension which adds this functionality.
Trailing Whitespace VS Code Plugin
It’d be really great if it were configurable and/or auto-detected on a per-file basis by the editor, and would really help my workflow.
Thanks so much, Andrew
Issue Analytics
- State:
- Created 5 years ago
- Reactions:48
- Comments:25
Top Results From Across the Web
Git diff -w ignore whitespace only at start & end of lines
This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent." There are a ......
Read more >How To Ignore Whitespace With Git Diff? - Tim Mousk
To ignore all line whitespaces with the git diff command, use the ignore-all-space option, like so: bash git diff --ignore-all-space.
Read more >w ignore whitespace only at start & end of lines - Intellipaat
I love to use git diff -w to ignore whitespace differences. But, I just noticed that it ignores even whitespace differences in the...
Read more >Git - diff-options Documentation
whitespace configuration. By default, trailing whitespaces (including lines that consist solely of whitespaces) and a space character that is immediately ...
Read more >diff - how to ignore empty lines
To ignore whitespaces, use the -b and -w switches: -b --ignore-space-change Ignore changes in the amount of white space. -w --ignore-all-space ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any solution to this isuue with or without an extension? It drives me crazy for months now. I would like the cursor to be placed respecting indentation in empty lines after formatting. Thanks!
Is there any movement on this? Really driving me crazy.