trim_trailing_whitespace = false not working
See original GitHub issue- I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
- I tried running
code --disable-extensions
and the issue did NOT present itself.
Delete the following condition if it doesn’t apply to your case:
If the extension is not picking up the expected configuration for a file:
- I tried
npm install editorconfig -g
and raneditorconfig [file-in-question]
and the configuration was what I expected. If not, please file on theeditorconfig-core-js
issue tracker.
Issue
Visual Studio Code | editorconfig-vscode | |
---|---|---|
Version | 1.12.2 |
0.9.3 |
Root .editorconfig
File
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
Are there any other relevant .editorconfig
files in your project? No
Visual Studio Code Setting | Default | User | Workspace |
---|---|---|---|
editor.insertSpaces |
true |
____ |
____ |
editor.tabSize |
4 |
2 |
_ |
editor.trimAutoWhitespace |
true |
____ |
____ |
files.autoSave |
"off" |
"___" |
"___" |
files.insertFinalNewline |
false |
true |
_____ |
files.trimTrailingWhitespace |
false |
true |
_____ |
File opened
./README.md
Expected behavior
trim_trailing_whitespace = false
Actual behavior
trim_trailing_whitespace = true
Additional comments or steps to reproduce
When I add 2 spaces to the end of a line to create a markdown line break and then save the file, the trailing spaces are removed. OS: Ubuntu 17.04
Issue Analytics
- State:
- Created 6 years ago
- Reactions:42
- Comments:38 (13 by maintainers)
Top Results From Across the Web
VisualStudio Code trimTrailingWhitespace set to false is still ...
Apparently the files.trimTrailingWhitespace: false is not doing anything at all as it continues to trim whitespace on the file(s) on save. These ...
Read more >editorconfig trim_trailing_whitespace only applies at end of file
The problem described here is simple: VS does not support .editorconfig file correctly. I do not know how the other issue could be...
Read more >editorconfig-checker
Compared to other linting tools this tool is language agnostic and works for every language and ... if you use the wrong repository...
Read more >.editorconfig `trim_trailing_whitespace` is ignored for ...
Relates to 4 issues (0 unresolved) ... IDEA-199518 Support trim_trailing_whitespace = false. 5. Is duplicated by 3 issues (0 unresolved).
Read more >User and Workspace Settings - vscode-docs
trimTrailingWhitespace ": false, //-------- File Explorer configuration -------- // Maximum number of working files to show before scrollbars appear.
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
i like my editor to trim whitespace. the only problem i have is with markdown files, where whitespace at the end is used for a newline. to workaround the problem i added this in vscode settings.json
I 100% agree, but the tests don’t cover this scenario, so it’s not exactly a supported feature. The
{}
braces are for multiple matches, so there’s really no reason to use them unless you’re trying to target multiple files or extensions like:☝️ that works. You know what also works?
So you can either add this scenario to the tests or just use
[{*.md,}]
or[*.md]
for now. Up to you!