-
Notifications
You must be signed in to change notification settings - Fork 13
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
js3-indent-tabs-mode doesn't seem to be respected in .dir-locals.el #105
Comments
I'm not sure how auto-indentation would even work with tabs in js3-mode. Currently it's designed to do a lot of "lining things up" for the most part. You might want to look at js2-mode, which will soon use the indentation from js-mode by default. |
Heya @mattdeboard. You could also use spaces, but tabify on a save? But that's a pretty ugly hack. |
Yeah I just switched to js2-mode. Seems fine for now, but js3-mode is so much faster parsing large files. |
@mattdeboard I also saw that here mooz/js2-mode#163 I don't understand how js2-mode is slower than js3-mode at parsing. I've made some changes to the parser but it's still basically the same, and I haven't seen much change on their end either. It would be interesting if this is because I yanked out the XML stuff or something. If this is because of something we're doing well here rather than a bug I haven't fixed or something, we should see if we can fix js2-mode to not be slow. |
Unfortunately I can't really give you the example I'm going from since it's proprietary code, but the upshot is it's the result of compiling a whole bunch of coffeescript files into a single JS file (via requirejs). The resulting file is about 61k lines of JS, not uglified or minified. Takes 10-15s for js2-mode to load it up, apply syntax highlighting and free up the process to the user. js3-mode takes ~5s if that. And it's extremely sluggish moving through the file even after it's fully loaded. It smells like a whole lot of parsing of the whole file over and over. |
So I'm working on a project that uses tabs instead of spaces. Normally I can set up my .dir-locals.el like so:
and tabs will be used instead of spaces. However it seems as though this is not the case with js3-mode. I'm doing the following:
but pressing
<TAB>
still inserts spaces. Also, when I do this, then check the value of the variable withC-h v js3-indent-tabs-mode
, it still reports asnil
. So I threw that out and just added the following to the top of the file:// -*- js3-indent-tabs-mode: t -*-
Now
C-h v js3-indent-tabs-mode
reports its buffer-local value ist
. But when I hit<TAB>
, it's still inserting spaces. So just on a lark, I updated the file header to:// -*- js3-indent-tabs-mode: t js3-manual-indentation: t -*-
Now
<TAB>
inserts TAB characters, but it of course only inserts one. So that's half a solution. Ideally though I could still have auto-indentation AND insert TAB characters instead of spaces.I'm on v1.1.0, Emacs 24.4.50
The text was updated successfully, but these errors were encountered: