Check personal Sublime settings folder for a jsbeautifyrc #296

Merged
merged 1 commit into from Apr 21, 2016

Projects

None yet

4 participants

@zertosh
Contributor
zertosh commented Mar 28, 2016

For those that only have a .jsbeautifyrc for Sublime-HTMLPrettify, it makes sense to keep it with the rest of the personal Sublime stuff. In the case of a Mac this location is ~/Library/Application Support/Sublime Text 3/Packages/User.

@zertosh
Contributor
zertosh commented Apr 19, 2016
@victorporof victorporof and 1 other commented on an outdated diff Apr 20, 2016
@@ -98,7 +98,7 @@ var a = 1;
```
## Using your own .jsbeautifyrc options
-The plugin looks for a `.jsbeautifyrc` file in the same directory as the source file you're prettifying (or any directory above if it doesn't exist, or in your home folder if everything else fails) and uses those options along the default ones. [Here](https://github.com/einars/js-beautify/blob/master/js/config/defaults.json)'s an example of how it can look like.
+The plugin looks for a `.jsbeautifyrc` file in the same directory as the source file you're prettifying (or any directory above if it doesn't exist), followed by your home folder, and lastly your personal Sublime settings folder. When one is found, it uses those options along the default ones. [Here](https://github.com/einars/js-beautify/blob/master/js/config/defaults.json)'s an example of how it can look like.
@victorporof
victorporof Apr 20, 2016 Owner

I think the rc file along the source code should have precedence over the one in sublime's settings folder. Am I misreading this?

@zertosh
zertosh Apr 20, 2016 Contributor

The order of precedence is: Same directory as source file -> Each parent directory -> $HOME -> Sublime settings dir.

I can reword this if you'd like.

@victorporof
victorporof Apr 20, 2016 Owner

Yeah, I believe it should be a bit reworded, it makes it sounds like it's the other way now.

@zertosh
zertosh Apr 20, 2016 Contributor

I've updated the PR.

@victorporof victorporof merged commit 270faa5 into victorporof:master Apr 21, 2016
@victorporof
Owner

Thanks!

@zertosh zertosh deleted the unknown repository branch Apr 21, 2016
@ZaLiTHkA
ZaLiTHkA commented Aug 6, 2016

Excuse the potentially silly question, but should this change work on all operating systems?

I'm running ST3 x86 build 3114 on Windows 10 Pro x64 and I've got a modified rules file at \Packages\User\.jsbeautifyrc, but when I call the auto formatting command, it still uses the default rules bundled with the package.

It works if I move the file to my Windows %USERPROFILE% folder, but it would be simpler to keep it in the ST3 User packages folder, simply because I synchronise this across 3 computers.

Before I create a new issue for this, I just wanted to check if this was already "known behaviour"..

@zertosh
Contributor
zertosh commented Aug 6, 2016

It should work on all OSes. Unfortunately, I don't have a Windows machine, so it's kinda hard for me to debug without extensive setup. Sorry.

@ZaLiTHkA
ZaLiTHkA commented Aug 8, 2016

Thanks @zertosh, I'll dig into this a bit more when I get a chance and see what else I can find.

@jasjuang

@ZaLiTHkA I ran into the same problem. My windows machine still uses the default rules bundled with the package even after I modify .jsbeautifyrc. But it works fine on my linux machine. Did you ever find a way to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment