mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Don't show the gutter when 'mini' is true on React editors
This commit is contained in:
parent
4020ed1535
commit
cc8b7b13b3
@ -1991,6 +1991,13 @@ describe "EditorComponent", ->
|
||||
runSetImmediateCallbacks()
|
||||
expect(lineNumberHasClass(4, 'cursor-line-no-selection')).toBe false
|
||||
|
||||
describe "when the 'mini' property is true", ->
|
||||
beforeEach ->
|
||||
component.setProps(mini: true)
|
||||
|
||||
it "does not render the gutter", ->
|
||||
expect(componentNode.querySelector('.gutter')).toBeNull()
|
||||
|
||||
describe "legacy editor compatibility", ->
|
||||
it "triggers the screen-lines-changed event before the editor:display-update event", ->
|
||||
editor.setSoftWrap(true)
|
||||
|
@ -50,7 +50,7 @@ EditorComponent = React.createClass
|
||||
|
||||
render: ->
|
||||
{focused, fontSize, lineHeight, fontFamily, showIndentGuide, showInvisibles, showLineNumbers, visible} = @state
|
||||
{editor, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
|
||||
{editor, mini, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props
|
||||
maxLineNumberDigits = editor.getLineCount().toString().length
|
||||
invisibles = if showInvisibles then @state.invisibles else {}
|
||||
hasSelection = editor.getSelection()? and !editor.getSelection().isEmpty()
|
||||
@ -86,7 +86,7 @@ EditorComponent = React.createClass
|
||||
className += ' has-selection' if hasSelection
|
||||
|
||||
div className: className, style: {fontSize, lineHeight, fontFamily}, tabIndex: -1,
|
||||
if showLineNumbers
|
||||
if not mini and showLineNumbers
|
||||
GutterComponent {
|
||||
ref: 'gutter', onMouseDown: @onGutterMouseDown, onWidthChanged: @onGutterWidthChanged,
|
||||
lineDecorations, defaultCharWidth, editor, renderedRowRange, maxLineNumberDigits, scrollViewHeight,
|
||||
|
Loading…
Reference in New Issue
Block a user