Allow setting editor text content in HTML

This commit is contained in:
Max Brunsfeld 2014-12-05 09:30:33 -08:00
parent d87d98278e
commit 4afe133f85
2 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,11 @@ describe "TextEditorElement", ->
element = jasmineContent.firstChild
expect(element.getModel().getPlaceholderText()).toBe 'testing'
it "honors the text content", ->
jasmineContent.innerHTML = "<atom-text-editor>testing</atom-text-editor>"
element = jasmineContent.firstChild
expect(element.getModel().getText()).toBe 'testing'
describe "when the model is assigned", ->
it "adds the 'mini' attribute if .isMini() returns true on the model", ->
element = new TextEditorElement

View File

@ -86,7 +86,7 @@ class TextEditorElement extends HTMLElement
buildModel: ->
@setModel(new TextEditor(
buffer: new TextBuffer
buffer: new TextBuffer(@textContent)
softWrapped: false
tabLength: 2
softTabs: true