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

Not working in Atom 1.12.* #25

Open
nahuelhds opened this issue Nov 11, 2016 · 10 comments
Open

Not working in Atom 1.12.* #25

nahuelhds opened this issue Nov 11, 2016 · 10 comments

Comments

@nahuelhds
Copy link

Yesterday I've updated to Atom 1.12.0 and this plugin doesn't work anymore.

I'm on Windows 10 64 bits.

Thanks!

@mtorromeo
Copy link

mtorromeo commented Nov 14, 2016

Same here with Atom 1.12.2 on Linux (I don't think the platform is relevant).
It seems like every time you select an editor tab atom reapplies its own indentation settings.

@mtorromeo
Copy link

mtorromeo commented Nov 14, 2016

I noticed that whatever sindresorhus/atom-editorconfig is doing, it is not affected by Atom's update and when I work on projects with a .editorconfig file the indentation settings are always respected.

You may want to take a look at how it is applying the settings.

@danfuzz
Copy link

danfuzz commented Nov 14, 2016

Maybe this is the same as #23, which I filed a few weeks ago. See also atom/atom#13141 which I filed on Atom core.

@tofof
Copy link

tofof commented Nov 15, 2016

+1

@forivall
Copy link

forivall commented Nov 26, 2016

I'm investigating a fix for this at https://github.com/forivall/auto-detect-indentation/tree/pane-focus-change-fix . I still need to update it so that the indentation is only automatically detected on first open, and then stored in a weak map.

Also, there needs to be coordination with atom-editorconfig, since both packages will load the indentation settings if they have no settings of their own to set. This will override the other's setting, depending on which gets invoked last.

Specifically, https://github.com/jtokoph/auto-detect-indentation/blob/06b3abdf/lib/indentation-manager.coffee#L75 and https://github.com/sindresorhus/atom-editorconfig/blob/6dd0a62d/index.js#L143 conflict with each other.

I'm thinking of:
(A): see if everything works fine without manually setting the default settings
(B): creating an "editor settings" provider/consumer like with https://github.com/steelbrain/linter, so that both this and editorconfig will provide editor settings, and if one doesn't provide settings, then the consumer tries the next.
(C): include the automatic detection directly in editorconfig, and explicitly state that they don't work together.

@adamshaylor
Copy link

I tried disabling atom-editorconfig. It doesn’t appear to be related.

@forivall
Copy link

forivall commented Dec 2, 2016

Yup, did some more digging, and it's also because https://github.com/atom/atom/blob/18ddcf9/src/text-editor-registry.js#L327 (called by https://github.com/atom/atom/blob/18ddcf9/src/text-editor-registry.js#L154) is run after auto-detect-indentation sets the indentation, and the .

Although, appearances can be deceiving. Editorconfig also does conflict, but the text-editor-registry conflict is more important. So I'll look into the text-editor-registry conflict first.

It could mean monkey patching something in text-editor-registry, and if both editorconfig and auto-detect-indentation would have to make use of a monkey patch, I'd want them to use the same monkey patch. (so I'd still use one of the above solutions)

Or, just delaying after TextEditorRegistry's initialPackageActivationPromise. I'll have to experiment later.

PS ugh, promise microtask queue. blink's async stack trace is my only hope
screen shot 2016-12-02 at 11 53 52 am

@villermen
Copy link

villermen commented Dec 9, 2016

A workaround for this issue while it is being addressed:

Save (Ctrl+S) after opening a file.

Saving also triggers indentation detection, and will happen after the promises this way.

@ddelrio1986
Copy link

I am noticing the same behavior. When I save the file it correctly detects the indentation.

@parasyte
Copy link

My current workaround is defining language-specific indentations. E.g. in the package settings for language-yaml and language-json, I've set Tab Length to 2.

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

9 participants