mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
When editor is split, set same cursor position on new editor and focus it.
This commit is contained in:
@@ -38,7 +38,7 @@ class Editor extends View
|
||||
autoIndent: null
|
||||
lineCache: null
|
||||
|
||||
initialize: () ->
|
||||
initialize: ({buffer}) ->
|
||||
requireStylesheet 'editor.css'
|
||||
requireStylesheet 'theme/twilight.css'
|
||||
@id = Editor.idCounter++
|
||||
@@ -46,7 +46,7 @@ class Editor extends View
|
||||
@bindKeys()
|
||||
@buildCursorAndSelection()
|
||||
@handleEvents()
|
||||
@setBuffer(new Buffer)
|
||||
@setBuffer(buffer ? new Buffer)
|
||||
@autoIndent = true
|
||||
|
||||
bindKeys: ->
|
||||
@@ -404,8 +404,8 @@ class Editor extends View
|
||||
horizontal = $$ -> @div class: 'horizontal'
|
||||
horizontal.insertBefore(this).append(this.detach())
|
||||
|
||||
editor = new Editor
|
||||
editor.setBuffer(@buffer)
|
||||
editor = new Editor({@buffer})
|
||||
editor.setCursorScreenPosition(@getCursorScreenPosition())
|
||||
@after(editor)
|
||||
@addClass 'split'
|
||||
editor.addClass('split')
|
||||
|
||||
Reference in New Issue
Block a user