From f00b0b7f7a1cd98d925a3d9739973819f865fcde Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 11:10:58 -0700 Subject: [PATCH 1/7] Add TextEditor::set/isGutterVisible Controls gutter visibility on individual editors. Signed-off-by: Max Brunsfeld --- spec/text-editor-component-spec.coffee | 31 +++++++++++++++++++------- src/text-editor-component.coffee | 8 +++---- src/text-editor.coffee | 11 +++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index e81dbb498..61e82f49f 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -552,14 +552,29 @@ describe "TextEditorComponent", -> nextAnimationFrame() expect(lineNumbersNode.style.backgroundColor).toBe 'rgb(255, 0, 0)' - describe "when the editor.showLineNumbers config is false", -> - it "doesn't render any line numbers", -> - expect(component.refs.gutter).toBeDefined() - atom.config.set("editor.showLineNumbers", false) - expect(component.refs.gutter).not.toBeDefined() - atom.config.set("editor.showLineNumbers", true) - expect(component.refs.gutter).toBeDefined() - expect(component.lineNumberNodeForScreenRow(3)).toBeDefined() + it "hides or shows the gutter based on the '::isGutterVisible' property on the model and the global 'editor.showLineNumbers' config setting", -> + expect(component.refs.gutter?).toBe true + + editor.setGutterVisible(false) + nextAnimationFrame() + + expect(component.refs.gutter?).toBe false + + atom.config.set("editor.showLineNumbers", false) + nextAnimationFrame() + + expect(component.refs.gutter?).toBe false + + editor.setGutterVisible(true) + nextAnimationFrame() + + expect(component.refs.gutter?).toBe false + + atom.config.set("editor.showLineNumbers", true) + nextAnimationFrame() + + expect(component.refs.gutter?).toBe true + expect(component.lineNumberNodeForScreenRow(3)?).toBe true describe "fold decorations", -> describe "rendering fold decorations", -> diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 1e8ea96d3..0668c9d2f 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -160,7 +160,7 @@ TextEditorComponent = React.createClass Math.max(1, Math.ceil(editor.getHeight() / editor.getLineHeightInPixels())) shouldRenderGutter: -> - not @props.mini and @state.showLineNumbers + not @props.mini and @props.editor.isGutterVisible() and atom.config.get('editor.showLineNumbers') getInitialState: -> {} @@ -463,7 +463,8 @@ TextEditorComponent = React.createClass scopeDescriptor = editor.getRootScopeDescriptor() subscriptions.add atom.config.observe 'editor.showIndentGuide', scope: scopeDescriptor, @setShowIndentGuide - subscriptions.add atom.config.observe 'editor.showLineNumbers', scope: scopeDescriptor, @setShowLineNumbers + subscriptions.add atom.config.onDidChange 'editor.showLineNumbers', scope: scopeDescriptor, @requestUpdate + subscriptions.add editor.onDidChangeGutterVisible @requestUpdate subscriptions.add atom.config.observe 'editor.scrollSensitivity', scope: scopeDescriptor, @setScrollSensitivity focused: -> @@ -1010,9 +1011,6 @@ TextEditorComponent = React.createClass setShowInvisibles: (showInvisibles) -> atom.config.set('editor.showInvisibles', showInvisibles) - setShowLineNumbers: (showLineNumbers) -> - @setState({showLineNumbers}) - setScrollSensitivity: (scrollSensitivity) -> if scrollSensitivity = parseInt(scrollSensitivity) @scrollSensitivity = Math.abs(scrollSensitivity) / 100 diff --git a/src/text-editor.coffee b/src/text-editor.coffee index aeaeb49ea..532bf8e92 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -536,6 +536,17 @@ class TextEditor extends Model isMini: -> @mini + setGutterVisible: (gutterVisible) -> + unless gutterVisible is @gutterVisible + @gutterVisible = gutterVisible + @emitter.emit 'did-change-gutter-visible', @gutterVisible + @gutterVisible + + isGutterVisible: -> @gutterVisible ? true + + onDidChangeGutterVisible: (callback) -> + @emitter.on 'did-change-gutter-visible', callback + # Set the number of characters that can be displayed horizontally in the # editor. # From 002918049d5f598a56002e92bf9b25fd831cabb1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 11:13:51 -0700 Subject: [PATCH 2/7] :racehorse: Cache gutterVisible state in React component This avoids a config read on every render. --- spec/text-editor-component-spec.coffee | 7 ++-- src/lines-component.coffee | 10 +++--- src/text-editor-component.coffee | 44 ++++++++++++++------------ src/text-editor-element.coffee | 1 - src/text-editor.coffee | 5 +++ 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index 61e82f49f..38a0f8c27 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -561,12 +561,12 @@ describe "TextEditorComponent", -> expect(component.refs.gutter?).toBe false atom.config.set("editor.showLineNumbers", false) - nextAnimationFrame() + expect(nextAnimationFrame).toBe noAnimationFrame expect(component.refs.gutter?).toBe false editor.setGutterVisible(true) - nextAnimationFrame() + expect(nextAnimationFrame).toBe noAnimationFrame expect(component.refs.gutter?).toBe false @@ -2517,7 +2517,8 @@ describe "TextEditorComponent", -> describe "when the 'mini' property is true", -> beforeEach -> - component.setProps(mini: true) + editor.setMini(true) + nextAnimationFrame() it "does not render the gutter", -> expect(componentNode.querySelector('.gutter')).toBeNull() diff --git a/src/lines-component.coffee b/src/lines-component.coffee index 272577097..ff8827a21 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -23,12 +23,12 @@ LinesComponent = React.createClass if performedInitialMeasurement {editor, overlayDecorations, highlightDecorations, scrollHeight, scrollWidth, placeholderText, backgroundColor} = @props {lineHeightInPixels, defaultCharWidth, scrollViewHeight, scopedCharacterWidthsChangeCount} = @props - {scrollTop, scrollLeft, cursorPixelRects, mini} = @props + {scrollTop, scrollLeft, cursorPixelRects} = @props style = height: Math.max(scrollHeight, scrollViewHeight) width: scrollWidth WebkitTransform: @getTransform() - backgroundColor: if mini then null else backgroundColor + backgroundColor: if editor.isMini() then null else backgroundColor div {className: 'lines', style}, div className: 'placeholder-text', placeholderText if placeholderText? @@ -162,7 +162,7 @@ LinesComponent = React.createClass @lineNodesByLineId.hasOwnProperty(lineId) buildLineHTML: (line, screenRow) -> - {mini, showIndentGuide, lineHeightInPixels, lineDecorations, lineWidth} = @props + {showIndentGuide, lineHeightInPixels, lineDecorations, lineWidth} = @props {tokens, text, lineEnding, fold, isSoftWrapped, indentLevel} = line classes = '' @@ -208,7 +208,7 @@ LinesComponent = React.createClass @buildEndOfLineHTML(line) or ' ' buildLineInnerHTML: (line) -> - {mini, showIndentGuide} = @props + {editor, showIndentGuide} = @props {tokens, text} = line innerHTML = "" @@ -217,7 +217,7 @@ LinesComponent = React.createClass lineIsWhitespaceOnly = firstTrailingWhitespacePosition is 0 for token in tokens innerHTML += @updateScopeStack(scopeStack, token.scopes) - hasIndentGuide = not mini and showIndentGuide and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly)) + hasIndentGuide = not editor.isMini() and showIndentGuide and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly)) innerHTML += token.getValueAsHtml({hasIndentGuide}) innerHTML += @popScope(scopeStack) while scopeStack.length > 0 diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 0668c9d2f..830bf8727 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -48,7 +48,7 @@ TextEditorComponent = React.createClass render: -> {focused, showIndentGuide, showLineNumbers, visible} = @state - {editor, mini, cursorBlinkPeriod, cursorBlinkResumeDelay, hostElement, useShadowDOM} = @props + {editor, cursorBlinkPeriod, cursorBlinkResumeDelay, hostElement, useShadowDOM} = @props maxLineNumberDigits = editor.getLineCount().toString().length hasSelection = editor.getLastSelection()? and !editor.getLastSelection().isEmpty() style = {} @@ -96,7 +96,7 @@ TextEditorComponent = React.createClass className += ' has-selection' if hasSelection div {className, style}, - if @shouldRenderGutter() + if @gutterVisible GutterComponent { ref: 'gutter', onMouseDown: @onGutterMouseDown, lineDecorations, defaultCharWidth, editor, renderedRowRange, maxLineNumberDigits, scrollViewHeight, @@ -118,7 +118,7 @@ TextEditorComponent = React.createClass @scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow, visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration, placeholderText, @performedInitialMeasurement, @backgroundColor, cursorPixelRects, - cursorBlinkPeriod, cursorBlinkResumeDelay, mini, useShadowDOM + cursorBlinkPeriod, cursorBlinkResumeDelay, useShadowDOM } ScrollbarComponent @@ -159,9 +159,6 @@ TextEditorComponent = React.createClass {editor} = @props Math.max(1, Math.ceil(editor.getHeight() / editor.getLineHeightInPixels())) - shouldRenderGutter: -> - not @props.mini and @props.editor.isGutterVisible() and atom.config.get('editor.showLineNumbers') - getInitialState: -> {} getDefaultProps: -> @@ -190,7 +187,7 @@ TextEditorComponent = React.createClass @domPollingIntervalId = setInterval(@pollDOM, @domPollingInterval) @updateParentViewFocusedClassIfNeeded({}) - @updateParentViewMiniClassIfNeeded({}) + @updateParentViewMiniClass() @checkForVisibilityChange() componentWillUnmount: -> @@ -202,9 +199,6 @@ TextEditorComponent = React.createClass clearInterval(@domPollingIntervalId) @domPollingIntervalId = null - componentWillReceiveProps: (newProps) -> - @props.editor.setMini(newProps.mini) - componentDidUpdate: (prevProps, prevState) -> cursorMoved = @cursorMoved selectionChanged = @selectionChanged @@ -214,7 +208,7 @@ TextEditorComponent = React.createClass if @props.editor.isAlive() @updateParentViewFocusedClassIfNeeded(prevState) - @updateParentViewMiniClassIfNeeded(prevState) + @updateParentViewMiniClass() @props.hostElement.__spacePenView.trigger 'cursor:moved' if cursorMoved @props.hostElement.__spacePenView.trigger 'selection:changed' if selectionChanged @props.hostElement.__spacePenView.trigger 'editor:display-updated' @@ -308,8 +302,8 @@ TextEditorComponent = React.createClass cursorPixelRects getLineDecorations: (decorationsByMarkerId) -> - {editor, mini} = @props - return {} if mini + {editor} = @props + return {} if editor.isMini() decorationsByScreenRow = {} for markerId, decorations of decorationsByMarkerId @@ -377,6 +371,8 @@ TextEditorComponent = React.createClass observeEditor: -> {editor} = @props @subscribe editor.onDidChange(@onScreenLinesChanged) + @subscribe editor.onDidChangeGutterVisible(@updateGutterVisible) + @subscribe editor.onDidChangeMini(@setMini) @subscribe editor.observeGrammar(@onGrammarChanged) @subscribe editor.observeCursors(@onCursorAdded) @subscribe editor.observeSelections(@onSelectionAdded) @@ -463,8 +459,7 @@ TextEditorComponent = React.createClass scopeDescriptor = editor.getRootScopeDescriptor() subscriptions.add atom.config.observe 'editor.showIndentGuide', scope: scopeDescriptor, @setShowIndentGuide - subscriptions.add atom.config.onDidChange 'editor.showLineNumbers', scope: scopeDescriptor, @requestUpdate - subscriptions.add editor.onDidChangeGutterVisible @requestUpdate + subscriptions.add atom.config.observe 'editor.showLineNumbers', scope: scopeDescriptor, @updateGutterVisible subscriptions.add atom.config.observe 'editor.scrollSensitivity', scope: scopeDescriptor, @setScrollSensitivity focused: -> @@ -882,7 +877,7 @@ TextEditorComponent = React.createClass @backgroundColor = backgroundColor @requestUpdate() unless suppressUpdate - if @shouldRenderGutter() + if @refs.gutter? gutterBackgroundColor = getComputedStyle(@refs.gutter.getDOMNode()).backgroundColor if gutterBackgroundColor isnt @gutterBackgroundColor @gutterBackgroundColor = gutterBackgroundColor @@ -1002,6 +997,16 @@ TextEditorComponent = React.createClass setShowIndentGuide: (showIndentGuide) -> @setState({showIndentGuide}) + setMini: -> + @updateGutterVisible() + @requestUpdate() + + updateGutterVisible: -> + gutterVisible = not @props.editor.isMini() and @props.editor.isGutterVisible() and atom.config.get('editor.showLineNumbers') + if gutterVisible isnt @gutterVisible + @gutterVisible = gutterVisible + @requestUpdate() + # Deprecated setInvisibles: (invisibles={}) -> grim.deprecate "Use config.set('editor.invisibles', invisibles) instead" @@ -1045,10 +1050,9 @@ TextEditorComponent = React.createClass @props.hostElement.classList.toggle('is-focused', @state.focused) @props.rootElement.classList.toggle('is-focused', @state.focused) - updateParentViewMiniClassIfNeeded: (prevProps) -> - if prevProps.mini isnt @props.mini - @props.hostElement.classList.toggle('mini', @props.mini) - @props.rootElement.classList.toggle('mini', @props.mini) + updateParentViewMiniClass: -> + @props.hostElement.classList.toggle('mini', @props.editor.isMini()) + @props.rootElement.classList.toggle('mini', @props.editor.isMini()) runScrollBenchmark: -> unless process.env.NODE_ENV is 'production' diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index 3cc52642a..e59a177d1 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -109,7 +109,6 @@ class TextEditorElement extends HTMLElement rootElement: @rootElement stylesElement: @stylesElement editor: @model - mini: @model.mini lineOverdrawMargin: @lineOverdrawMargin useShadowDOM: @useShadowDOM ) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 532bf8e92..24436f3a3 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -533,9 +533,14 @@ class TextEditor extends Model if mini isnt @mini @mini = mini @updateInvisibles() + @emitter.emit 'did-change-mini', @mini + @mini isMini: -> @mini + onDidChangeMini: (callback) -> + @emitter.on 'did-change-mini', callback + setGutterVisible: (gutterVisible) -> unless gutterVisible is @gutterVisible @gutterVisible = gutterVisible From c0b78db1596079256de32135595476d47f17ddf1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 11:18:49 -0700 Subject: [PATCH 3/7] :lipstick: Signed-off-by: Max Brunsfeld --- spec/text-editor-element-spec.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index f29a8f91b..a5f72a8ec 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -10,12 +10,12 @@ describe "TextEditorElement", -> jasmineContent = document.body.querySelector('#jasmine-content') describe "instantiation", -> - it "honors the mini attribute", -> + it "honors the 'mini' attribute", -> jasmineContent.innerHTML = "" element = jasmineContent.firstChild expect(element.getModel().isMini()).toBe true - it "honors the placeholder-text attribute", -> + it "honors the 'placeholder-text' attribute", -> jasmineContent.innerHTML = "" element = jasmineContent.firstChild expect(element.getModel().getPlaceholderText()).toBe 'testing' From 43f57347d743fcb51e929ae4ef63984ff0026bcf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 11:19:23 -0700 Subject: [PATCH 4/7] =?UTF-8?q?Add=20=E2=80=98gutter-hidden=E2=80=99=20att?= =?UTF-8?q?ribute=20to=20TextEditorElement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Max Brunsfeld --- spec/text-editor-element-spec.coffee | 5 +++++ src/text-editor-element.coffee | 1 + src/text-editor.coffee | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index a5f72a8ec..cbcc5fc16 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -20,6 +20,11 @@ describe "TextEditorElement", -> element = jasmineContent.firstChild expect(element.getModel().getPlaceholderText()).toBe 'testing' + it "honors the 'gutter-hidden' attribute", -> + jasmineContent.innerHTML = "" + element = jasmineContent.firstChild + expect(element.getModel().isGutterVisible()).toBe false + it "honors the text content", -> jasmineContent.innerHTML = "testing" element = jasmineContent.firstChild diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index e59a177d1..38b980b65 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -100,6 +100,7 @@ class TextEditorElement extends HTMLElement tabLength: 2 softTabs: true mini: @hasAttribute('mini') + gutterVisible: not @hasAttribute('gutter-hidden') placeholderText: @getAttribute('placeholder-text') )) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 24436f3a3..826b4863a 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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 From 69262362683be6f79a1b05735b00b1011740acb0 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 11:36:46 -0700 Subject: [PATCH 5/7] =?UTF-8?q?Handle=20addition/removal=20of=20=E2=80=98g?= =?UTF-8?q?utter-hidden=E2=80=99=20attribute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Max Brunsfeld --- spec/text-editor-element-spec.coffee | 11 +++++++++++ src/text-editor-element.coffee | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index cbcc5fc16..858d835a5 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -30,6 +30,17 @@ describe "TextEditorElement", -> element = jasmineContent.firstChild expect(element.getModel().getText()).toBe 'testing' + describe "when attributes change", -> + it "honors addition/removal of the 'gutter-hidden' attribute", -> + element = new TextEditorElement + expect(element.getModel().isGutterVisible()).toBe true + + element.setAttributeNode(document.createAttribute("gutter-hidden")) + expect(element.getModel().isGutterVisible()).toBe false + + element.removeAttribute('gutter-hidden') + expect(element.getModel().isGutterVisible()).toBe true + describe "when the model is assigned", -> it "adds the 'mini' attribute if .isMini() returns true on the model", -> element = new TextEditorElement diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index 38b980b65..3e4f7924e 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -71,6 +71,10 @@ class TextEditorElement extends HTMLElement @unmountComponent() @emitter.emit("did-detach") + attributeChangedCallback: (name, oldValue, newValue) -> + if name is 'gutter-hidden' + @getModel().setGutterVisible(not @hasAttribute('gutter-hidden')) + initialize: (model) -> @setModel(model) this From dd80226c2301917acabb0a48ba2c7efbd10f76f6 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 17:39:07 -0700 Subject: [PATCH 6/7] =?UTF-8?q?Revert=20"Handle=20addition/removal=20of=20?= =?UTF-8?q?=E2=80=98gutter-hidden=E2=80=99=20attribute"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 69262362683be6f79a1b05735b00b1011740acb0. There seems to be some bug or timing issue that prevents the attachedCallback from being called in all cases when the attributeChangedCallback is defined. We can figure this out at a later time. --- spec/text-editor-element-spec.coffee | 11 ----------- src/text-editor-element.coffee | 4 ---- 2 files changed, 15 deletions(-) diff --git a/spec/text-editor-element-spec.coffee b/spec/text-editor-element-spec.coffee index 858d835a5..cbcc5fc16 100644 --- a/spec/text-editor-element-spec.coffee +++ b/spec/text-editor-element-spec.coffee @@ -30,17 +30,6 @@ describe "TextEditorElement", -> element = jasmineContent.firstChild expect(element.getModel().getText()).toBe 'testing' - describe "when attributes change", -> - it "honors addition/removal of the 'gutter-hidden' attribute", -> - element = new TextEditorElement - expect(element.getModel().isGutterVisible()).toBe true - - element.setAttributeNode(document.createAttribute("gutter-hidden")) - expect(element.getModel().isGutterVisible()).toBe false - - element.removeAttribute('gutter-hidden') - expect(element.getModel().isGutterVisible()).toBe true - describe "when the model is assigned", -> it "adds the 'mini' attribute if .isMini() returns true on the model", -> element = new TextEditorElement diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index 3e4f7924e..38b980b65 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -71,10 +71,6 @@ class TextEditorElement extends HTMLElement @unmountComponent() @emitter.emit("did-detach") - attributeChangedCallback: (name, oldValue, newValue) -> - if name is 'gutter-hidden' - @getModel().setGutterVisible(not @hasAttribute('gutter-hidden')) - initialize: (model) -> @setModel(model) this From eee31c3e8c6a67cde98efa74af3d2ce1082d3497 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Jan 2015 17:56:47 -0700 Subject: [PATCH 7/7] =?UTF-8?q?Don=E2=80=99t=20use=20component=20property?= =?UTF-8?q?=20for=20TextEditorView::mini=20shim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Max Brunsfeld --- src/text-editor-view.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-editor-view.coffee b/src/text-editor-view.coffee index b5e60aa8e..bcd0dcfb1 100644 --- a/src/text-editor-view.coffee +++ b/src/text-editor-view.coffee @@ -127,7 +127,7 @@ class TextEditorView extends View Object.defineProperty @::, 'lastRenderedScreenRow', get: -> @component.getRenderedRowRange()[1] Object.defineProperty @::, 'active', get: -> @is(@getPaneView()?.activeView) Object.defineProperty @::, 'isFocused', get: -> document.activeElement is @element or document.activeElement is @element.component?.refs.input.getDOMNode() - Object.defineProperty @::, 'mini', get: -> @component?.props.mini + Object.defineProperty @::, 'mini', get: -> @model?.isMini() Object.defineProperty @::, 'component', get: -> @element?.component afterAttach: (onDom) ->