Allow multiple space-delimited classes for highlight decorations

Fixes #5747
This commit is contained in:
Nathan Sobo
2015-02-25 14:35:24 -07:00
parent fb89f04c5d
commit 986e8bf85f
2 changed files with 20 additions and 2 deletions

View File

@@ -1171,6 +1171,14 @@ describe "TextEditorComponent", ->
regions = componentNode.querySelectorAll('.test-highlight .region')
expect(regions.length).toBe 2
it "allows multiple space-delimited decoration classes", ->
decoration.setProperties(type: 'highlight', class: 'foo bar')
nextAnimationFrame()
expect(componentNode.querySelectorAll('.foo.bar').length).toBe 1
decoration.setProperties(type: 'highlight', class: 'bar baz')
nextAnimationFrame()
expect(componentNode.querySelectorAll('.bar.baz').length).toBe 1
it "renders classes on the regions directly if 'deprecatedRegionClass' option is defined", ->
decoration = editor.decorateMarker(marker, type: 'highlight', class: 'test-highlight', deprecatedRegionClass: 'test-highlight-region')
nextAnimationFrame()