Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Opening settings view rewrites newline characters in config.cson #560

Open
evanwarner opened this issue Jun 30, 2015 · 4 comments
Open

Opening settings view rewrites newline characters in config.cson #560

evanwarner opened this issue Jun 30, 2015 · 4 comments

Comments

@evanwarner
Copy link

General issue:
I have a few key:value pairs in my config.cson file that have "\n" as the value. If I open Atom's settings view, those values get immediately overwritten with triple quotes surrounding blank lines of indentation.

So for example:

    "space-after-opening-brace": "\n"

becomes

    "space-after-opening-brace": '''


    '''

The issue is recreatable in safe mode, and no errors appear in the dev tools.

Specific details:
If I leave Atom open and edit the config file back to the correct "\n" values, I can toggle back and forth to settings and it will stay correct. However, if I change any settings or enable/disable a package, the config file is overwritten again.

bug

Atom v1.0.0 on OS X 10.9.5

Moved from atom/atom#7569

@benogle
Copy link
Contributor

benogle commented Jun 30, 2015

I can reproduce this. Super weird that it makes 2 newlines with indentation.

@evanwarner
Copy link
Author

I've noticed that whatever triggers this error also adds more indentation every time it happens. Open config.cson and settings view in different panes (so you can watch the config file) then just keep toggling the "Audio Beep" checkbox. Additional indentation will be added with every toggle.

@benogle
Copy link
Contributor

benogle commented Jul 6, 2015

I've noticed more indentation on each update as well. Sorry about this.

@evanwarner
Copy link
Author

So I've just discovered some more quirky behavior that may help figure this out. The package I'm configuring with those newline values is CSSComb. By default this plugin has no configurable settings in Settings > Packages > CSSComb. When I manually enter the configuration into config.cson, then visit Settings > Packages > CSSComb, all the options I manually set have gained GUI config fields in the package settings. (I assume this is a feature of settings view.)

However, as soon as I open Settings > Packages > CSSComb, my config.cson goes into an infinite loop, appending more indentation every half second. Closing settings view does not stop this. Closing config.cson does not stop this. I have to quit Atom otherwise it will just continue to write indentation.

So then I tried something else: I edited config.cson back to normal, but instead of "\n" I just put "xxx" in for those values. As expected, nothing unusual happened when I opened Settings > Packages > CSSComb. Then I went and copied a hard return character and pasted it directly into one of the GUI config fields that was now enabled. The indentation bug started happening in the GUI field itself. It expanded to two lines and every half second appended a chunk of indentation.

So it seems that the textfields in settings view don't like having newline characters within them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants