mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add ‘gutter-hidden’ attribute to TextEditorElement
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
@@ -20,6 +20,11 @@ describe "TextEditorElement", ->
|
||||
element = jasmineContent.firstChild
|
||||
expect(element.getModel().getPlaceholderText()).toBe 'testing'
|
||||
|
||||
it "honors the 'gutter-hidden' attribute", ->
|
||||
jasmineContent.innerHTML = "<atom-text-editor gutter-hidden>"
|
||||
element = jasmineContent.firstChild
|
||||
expect(element.getModel().isGutterVisible()).toBe false
|
||||
|
||||
it "honors the text content", ->
|
||||
jasmineContent.innerHTML = "<atom-text-editor>testing</atom-text-editor>"
|
||||
element = jasmineContent.firstChild
|
||||
|
||||
@@ -100,6 +100,7 @@ class TextEditorElement extends HTMLElement
|
||||
tabLength: 2
|
||||
softTabs: true
|
||||
mini: @hasAttribute('mini')
|
||||
gutterVisible: not @hasAttribute('gutter-hidden')
|
||||
placeholderText: @getAttribute('placeholder-text')
|
||||
))
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class TextEditor extends Model
|
||||
'$verticalScrollbarWidth', '$horizontalScrollbarHeight', '$scrollTop', '$scrollLeft',
|
||||
'manageScrollPosition', toProperty: 'displayBuffer'
|
||||
|
||||
constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText}) ->
|
||||
constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText, @gutterVisible}) ->
|
||||
super
|
||||
|
||||
@emitter = new Emitter
|
||||
|
||||
Reference in New Issue
Block a user