jsformat-atom icon indicating copy to clipboard operation
jsformat-atom copied to clipboard

When invoked jsformat sometimes ignores the expand tabs to spaces setting and uses tabs

Open jeffschwartz opened this issue 10 years ago • 3 comments

It seems to happen in one particular file in one of my projects which makes it weird and hard to reproduce. My Atom is configures with soft tabs and tab length = to 4.

jeffschwartz avatar Dec 27 '14 22:12 jeffschwartz

Same here, even though Atom is set to use spaces, JSFormat reformats all my JS files using tabs.

tp avatar Feb 02 '15 15:02 tp

I suppose that whatever is selected in the plugin preferences, the plugin does just the opposite. I switched it to use tabs and it it uses spaces now :)

Imho this plugin preference should be removed and the plugin should use the default from Atom preferences.

EDIT: I was wrong. Looks like it's random....

mik01aj avatar Feb 10 '15 16:02 mik01aj

I have the same random behavior, fixed it, but for some reason I don't understand how it makes the thing work:

 -    opts.indent_with_tabs = editor.getSoftTabs()
 +    opts.indent_with_tabs = editor.getSoftTabs() isnt true

Also, in the very same part of code, this seems more consistent:

 -    opts.indent_size = editorSettings.tabLength
 +    opts.indent_size = editor.getTabLength()

brunosabot avatar Feb 27 '15 09:02 brunosabot