Skip to content
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

Indentation in Brackets 1.3 does not work as expected #38

Open
rasmk opened this issue Apr 29, 2015 · 7 comments
Open

Indentation in Brackets 1.3 does not work as expected #38

rasmk opened this issue Apr 29, 2015 · 7 comments

Comments

@rasmk
Copy link

rasmk commented Apr 29, 2015

After Brackets update to 1.3, TS code indentation started behaving strangely.
Example:

  • I type if ( - right after I open parenthesis, the whole line jumps one or two tabs to the right
  • I continue typing 2 > 1) { - right after the brace the whole line jumps to the column 1 (all indentation spaces are removed)
  • afterwards the line remains there, subsequent lines are aligned to it

When I downgrade Brackets to 1.2, everything is fine again. Looks like a breaking change in 1.3.

So far the solution is to stay on 1.2. The problem needs a solution though.
Meanwhile, is there a way to disable the formatting in the plugin with some configuration options? I had a look into the sources, but I have not found anything.

@senhongo
Copy link

senhongo commented Jul 9, 2015

Also having indentation problems, but only when with the : sign. Everytime I use a colon, the whole line is un-indented by either 1 indent or all indents. In the below example, adding a colon to bar, would un-indent it by 2 spaces.

interface HTMLElement {
  foo: boolean;
  bar
}

This example is more deeply indented. Adding a colon to foo, would un-indent the entire line.

  export class ApplicationDetail {
    application: st.response.applications.ApplicationInfo;
    timeline: Array<TimelineItem>;
    foo

@Treer
Copy link

Treer commented Aug 4, 2015

Just updated Brackets to 1.4 and still get the problems described by rasmk and SenHeng, it makes using typescript in Brackets quite a pain.

@aaronbeall
Copy link

Having the same problems in Brackets 1.4. After typing ":" or "{" it moves line indent to left. After pressing "(" it adds extra indent to right. Seeing as how common those symbols are, it makes editing quite painful. I also could not find a way to disable the auto-indentation in Brackets.

@senhongo
Copy link

senhongo commented Oct 2, 2015

Only way to disable auto-indent in Brackets is through the preferences file.
I remember it being something like 'auto-indent' but all I could find in my prefs was smartIndent. I guess maybe the name was changed?

"smartIndent": false,

Here's a useful plug-in that shows a list of all current preferences and their default values. Should make finding the relevant tags easier.

@JoshDrentlaw
Copy link

Still not working as of 1.5

turning smartIndent to false didn't help.

Has anyone found a solution?

@JJBocanegra
Copy link

It worked for me when I turned off smartIndent, but it will be very helpful if there is a workaround for turn it off just when is a TypeScript file.

@wakino
Copy link

wakino commented Feb 5, 2016

Thanks SenHeng!
it works on Brackets 1.5.

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

No branches or pull requests

7 participants