Merge pull request #4406 from atom/mb-editor-text-content

Allow setting editor text content in HTML
This commit is contained in:
Max Brunsfeld 2014-12-05 09:44:29 -08:00
commit 790c125e0b
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