Add a test for the indent fix

This commit is contained in:
Sander van Harmelen 2015-07-23 19:23:03 +02:00
parent 46625b9a22
commit df1b193eba

View File

@ -2272,6 +2272,17 @@ describe "TextEditor", ->
expect(editor.indentationForBufferRow(1)).toBe 1
expect(editor.indentationForBufferRow(2)).toBe 0
it "indents the new line to the current level when editor.autoIndent is true and no increaseIndentPattern is specified", ->
runs ->
atom.config.set("editor.autoIndent", true)
editor.setGrammar(atom.grammars.selectGrammar("file"))
editor.setText(' if true')
editor.setCursorBufferPosition([0, 8])
editor.insertNewline()
expect(editor.getGrammar()).toBe atom.grammars.nullGrammar
expect(editor.indentationForBufferRow(0)).toBe 1
expect(editor.indentationForBufferRow(1)).toBe 1
it "indents the new line to the correct level when editor.autoIndent is true and using a off-side rule language", ->
waitsForPromise ->
atom.packages.activatePackage('language-coffee-script')