-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
hint about where to put web-mode setq #7090
Conversation
Web-mode ignores settings set in `dotspacemacs/user-config` on the file opened at launch (though it picks them up for subsequent files), so it took me a while to figure out that I needed to put them in `dotspacemacs/user-init`. This might be nice to save some other people the anguish.
Quoting @NJBS
Does anyone else experience problems when placing configs in |
Strange, I have quite a vanilla install of spacemacs so I'm not sure what would be causing this only for me… If you still can't reproduce I can try to reproduce it in a fresh spacemacs install in a docker image or something, to reduce other variables / so you can see for yourself. |
If you can put together a list of reproduction steps and maybe an example file I'd be happy to try to reproduce 😄 ! Currently adding (setq-default
;; js2-mode
js2-basic-offset 2
;; web-mode
css-indent-offset 2
web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-attr-indent-offset 2) to my |
Hi @NJBS sorry for the slow response. The interesting part is that the issue only occurs when you open a jsx file from the command line, e.g. Maybe that tip is enough for you to reproduce, but if not I'm able to reproduce it on a fresh Debian 8 (though I also get the same behavior on my Mac) as follows: apt update
apt install emacs-nox git
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
emacs Then add the (setq-default
;; js2-mode
js2-basic-offset 2
;; web-mode
css-indent-offset 2
web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-attr-indent-offset 2
) Then open a jsx file from the command line (doesn't matter if it exists already or not): emacs test.jsx If you write some code, you'll notice that the indent is 4 spaces. And if you do
However if you instead open a jsx file with
This only happens with jsx files, normal js is fine. I hope that helps narrow it down, let me know if you have any questions. 👍 |
So this is about #7202 actually. It's not a documentation problem IMO, and it certainly has nothing to do with web-mode. |
Oh okay thanks, I'm glad it's a known bug. I'm surprised more people don't encounter it; is it rare to open files from the command line? Thanks for all your help, I'll close this now. |
Web-mode ignores settings set in
dotspacemacs/user-config
on the file opened at launch (though it picks them up for subsequent files), so it took me a while to figure out that I needed to put them indotspacemacs/user-init
. This might be nice to save some other people the anguish.