[Solved] editor:newline behaves differently in package spec


#1

The editor:newline command is behaving differently in the real text editor than it is when running in a package spec.

I have a package that reindents the user’s selection, and it works fine in the editor. The specs also ran successfully until v1.23.

If I write in a python file “for x in y:” and run the editor:newline command, a newline along with four spaces is inserted. If I do the same in the package spec, the newline is entered but no spaces are inserted. I’ve verified that the editor’s scope is source.python in both cases.

The problem seems related to [Solved] Spec fails, but works right in editor but I do activate the necessary language packages. It also seems like the problem could be related to atom PR #15990 but I’m able to open a test file with no error.

Source code: https://github.com/kbrose/atom-reindent

Any help would be greatly appreciated!


#2

The problem was that autoIndent was defaulting to false instead of true. Ugh.

Adding editor.autoIndent = true to the beforeEach sections of the spec fixed the issue.