mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Handle indentation with mixed tabs and spaces
This commit is contained in:
@@ -3707,11 +3707,12 @@ describe "TextEditor", ->
|
||||
expect(editor.indentLevelForLine("\t\thello")).toBe(2)
|
||||
|
||||
it "returns the indent level based on the character starting the line when the leading whitespace contains both spaces and tabs", ->
|
||||
expect(editor.indentLevelForLine("\t hello")).toBe(1)
|
||||
expect(editor.indentLevelForLine(" \thello")).toBe(1)
|
||||
expect(editor.indentLevelForLine(" \t hello")).toBe(1)
|
||||
expect(editor.indentLevelForLine(" \t \thello")).toBe(2)
|
||||
expect(editor.indentLevelForLine(" \t \thello")).toBe(2.5)
|
||||
expect(editor.indentLevelForLine("\t hello")).toBe(2)
|
||||
expect(editor.indentLevelForLine(" \thello")).toBe(2)
|
||||
expect(editor.indentLevelForLine(" \t hello")).toBe(2.5)
|
||||
expect(editor.indentLevelForLine(" \t \thello")).toBe(4)
|
||||
expect(editor.indentLevelForLine(" \t \thello")).toBe(4)
|
||||
expect(editor.indentLevelForLine(" \t \t hello")).toBe(4.5)
|
||||
|
||||
describe "when the buffer is reloaded", ->
|
||||
it "preserves the current cursor position", ->
|
||||
|
||||
Reference in New Issue
Block a user