-
Notifications
You must be signed in to change notification settings - Fork 205
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
Auto-indent doesn't work? #159
Comments
No plan for a financial donation mechanism at the moment ❤️. It would be great if you can [leave a review on twitter](https://twitter.com/intent/tweet?text=Silky smooth TypeScript development&url=https://atom.io/packages/atom-typescript&hashtags=Atom,TypeScript&via=basarat) ref : #66 |
It doesn't work. We didn't do any special work to tweak to so it was expected. As you can see in the gif Atom is doing something for TypeScript files in that the brackets are placed correctly but you still need to indent the cursor into place. I suspect its done because of |
research : https://github.com/griiin/atom-auto-indent/blob/master/lib/auto-indent.coffee editor = atom.workspace.activePaneItem
cursor = editor.getCursor()
savedPosition = cursor.getScreenPosition()
editor.selectAll()
editor.autoIndentSelectedRows()
cursor = editor.getCursor()
cursor.setScreenPosition(savedPosition) More : |
The non dynamic grammars get their indent settings from : https://github.com/atom/language-javascript/blob/master/settings/language-javascript.cson |
I've differentiated the punctuation. TS was classifying each seperately. Atom is just efficient to collapse adjacent similar classifications into a single DOM node. I still pushed my commit as it make it easier for us to reuse |
However this was not the source of the problem and I am still looking for a solution |
I've asked for help https://discuss.atom.io/t/need-help-fixing-autoindent/15322 |
Well figured it out myself. There are plenty for dragons in writing our dynamic grammar. The tricky one here was that atom wants you to tokenize an empty line as whitespace (or anything with a name) for autoindent to work ❤️ |
|
Looks good! Thanks :-) Something that confused me is, in ATOM's core settings, there's an "Auto Indent" checkbox, which apparently does nothing at all. In the "Edit" menu, in the "Lines" submenu, there's also an "Auto Indent" checkbox menu item, which doesn't appear to be the same setting - it's unchecked, even though I checked the one on the core settings screen... Anyway, checked the one in the menu, and, behold, that one actually works - the one in the core settings screen doesn't seem to have any effect at all. I wonder why there's two of these... |
…utoindent logic to work closes TypeStrong/atom-typescript#159
The only problem I have with this plugin so far, is it seems to mess up auto-indent?
Using ATOM 0.186, with "Auto Indent" enabled, "Show Indent Guide" switched on, "Tab Length" set to 4 and "Soft Tabs" enabled.
Whenever I press ENTER in the editor, the cursor positions itself at the beginning of the line.
I have no other community packages installed, just this one.
PS: Thank you for this incredible plugin! I have tried every other Typescript plugin for ATOM (typescript-atomizer, language-typescript and atom-typescript-tools) some of which threw errors, none of which were able to even auto-complete. Excellent work!
Are you getting paid for this work, or where can we donate?
The text was updated successfully, but these errors were encountered: