Closed stefanosc closed 4 years ago
Same here with Diff. When changing a syntax to Diff and saving the file it still strips out the trailing space?
I have the same problem. I'd like to ignore jade files but including "jade" or ".jade" in the ignore command doesn't work.
Isn't possible to create an RegEx which excludes \s{2}$
? I tried to code it, but I don't have enough expertise for it.
Wow... issue zombie which maybe is appropriate for Halloween.
I believe this can be marked as 'resolved' because there is a setting for ignoring specific files BASED ON SYNTAX and it works if you have things configured right.
The mistake people are maybe making is putting the extension in the plugin configuration, which isn't going to work. Per the docs, it's expecting the syntax ST is using to format in the UI, not the file extension. So you would need to enter 'Markdown' or 'Diff', NOT '.md' or '.diff' or whatever.
Another mistake people are maybe making is having trim_automatic_white_space
turned on globally for ST, which I think would clobber any settings for this plugin. I'm not going to bother testing that, but it's a good guess, right? 😀
If it helps, have this config for global settings:
// in ~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings
...
"trim_automatic_white_space": false,
...
And this for TrailingSpaces
// ~/Library/Application Support/Sublime Text 3/Packages/User/trailing_spaces.sublime-settings
{
"trailing_spaces_modified_lines_only": true,
"trailing_spaces_trim_on_save": true,
"trailing_spaces_syntax_ignore": ["Markdown"]
}
And it works.
I'm using ST3 build 3126 if that matter.
HTH, Happy Halloween! 👻
Using just "Markdown"
didn't work for me. I had to set it like this:
{
"trailing_spaces_modified_lines_only": true,
"trailing_spaces_trim_on_save": true,
"trailing_spaces_syntax_ignore": ["Packages/Markdown/Markdown.sublime-syntax"]
}
in ~/Library/Application Support/Sublime Text 3/Packages/User/trailing_spaces.sublime-settings
Markdown
worked for me (on Debian Jessie) as @misterbrownlee said. Also note it seems like it is a necessity to restart ST after the configuration change.
If someone is wondering how to get this behaviour with the built-in white space trimmer:
In the general settings file ("Preferences" → "Settings"):
"trim_trailing_white_space_on_save": true
Open a patch or switch to the Diff syntax, go to "Preferences" → "Settings - Syntax Specific":
"trim_trailing_white_space_on_save": false
I'm on MacOS 10.13.4, Sublime Text 3.1.1 Build 3176.
Configuration options for this package need to be set in package-specific settings (Preferences: Trailing Spaces Settings
from command palette). They won't work from global preferences or syntax settings (latter will probably be supported eventually).
Closing this as "user error".
Hello and thank you for your work on this nifty plugin.
I am trying to exclude markdown files from the trim trailing spaces. I tried to set it up in my preferences in many ways but can't get it to work, not matter what I do it trims the spaces in markdown. Here are my Sublime preferences Am I missing something or there is something not working? Thank you very much!