mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Update cursor view when selection screen position changes
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
{React, div} = require 'reactionary'
|
||||
SubscriberMixin = require './subscriber-mixin'
|
||||
CursorComponent = require './cursor-component'
|
||||
|
||||
module.exports =
|
||||
SelectionComponent = React.createClass
|
||||
render: ->
|
||||
console.log "render selection component"
|
||||
mixins: [SubscriberMixin]
|
||||
|
||||
render: ->
|
||||
{selection, lineHeight, charWidth} = @props
|
||||
{cursor} = selection
|
||||
div className: 'selection',
|
||||
CursorComponent({cursor, lineHeight, charWidth})
|
||||
|
||||
componentDidMount: ->
|
||||
@subscribe @props.selection, 'screen-range-changed', => @forceUpdate()
|
||||
|
||||
componentWillUnmount: ->
|
||||
@unsubscribe()
|
||||
|
||||
Reference in New Issue
Block a user