Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing whitespaces #115

Closed
kachkaev opened this Issue May 27, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@kachkaev
Copy link

commented May 27, 2016

Hi David,

I quite liked your package and decided to use it as a replacement for language-gfm. However, after a short while I noticed that the trailing spaced started to disappear on save. This is because of a default behaviour in Atom's workspace package. I tried to disable this by doing what they suggest in readme:

config.cson:

"*":
  ...
  whitespace:
    ".text.md":
      removeTrailingWhitespace: false

Tried a few other ways of expressing my intention in the config, but none worked. Unfortunately, I had to give up and return to gfm, since restoring the whitespaces before every commit is a pain. Could you please update the docs or implement something to make it possible to keep the spaces before the newline characters?

I imagine this can be possible already. In this case the path to the solution is probably too complex or unclear.

@burodepeper

This comment has been minimized.

Copy link
Owner

commented May 27, 2016

I think the "error" is in your config.cson. The setting doesn't seem to work as part of the * scope, but it does (for me) in the .md.text scope. If you scroll quite far down in config.cson you'll find that particular key there, otherwise add it yourself. The correct config should then be (or at least, this is what works for me):

".md.text":
  whitespace:
    removeTrailingWhitespace: false

Make sure that there is no leading whitespace, otherwise you're in some other scope.

@kachkaev

This comment has been minimized.

Copy link
Author

commented May 27, 2016

Finally got it, thank you! The example (if you decide to add it later on) should probably include the default * scope too.

"*":
  # all current config
".md.text":
  whitespace:
    removeTrailingWhitespace: false

My confusion was caused by the lack of context in the example. Might be worth adding it to save others from the same pitfall.

@burodepeper

This comment has been minimized.

Copy link
Owner

commented May 27, 2016

Thanks, I will, and it's silly that your own solution didn't work. Anyway, good luck, and I hope I've regained a user! ; )

@Morikko

This comment has been minimized.

Copy link

commented Apr 7, 2017

Hi, today I faced the same problem and hopefully I found your solution. Thanks a lot!

However, the solution is hidden in a closed issue.
Wouldn't it be good to add a note in the README ? Either to link to that post or to a clear message directly ?

@burodepeper

This comment has been minimized.

Copy link
Owner

commented Apr 7, 2017

@Morikko Very true, and I suppose I had planned to add it to the FAQ. I'll re-open this and add it there, and possibly extend the README to include at least (some of) the topics covered in the FAQ.

@burodepeper burodepeper reopened this Apr 7, 2017

@burodepeper

This comment has been minimized.

Copy link
Owner

commented May 1, 2017

Update FAQ and README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.