Merge branch 'master' into kq

This commit is contained in:
Nathan Sobo
2012-04-26 11:38:22 -06:00
4 changed files with 33 additions and 19 deletions

View File

@@ -17,9 +17,11 @@ class Cursor extends View
@editor = editor
@anchor = new Anchor(@editor, screenPosition)
@selection = @editor.compositeSelection.addSelectionForCursor(this)
@one 'attach', =>
@updateAppearance()
@editor.syncCursorAnimations()
afterAttach: (onDom) ->
return unless onDom
@updateAppearance()
@editor.syncCursorAnimations()
handleBufferChange: (e) ->
@anchor.handleBufferChange(e)

View File

@@ -208,14 +208,15 @@ class Editor extends View
else
@gutter.addClass('drop-shadow')
@on 'attach', (e) =>
return if @attached
@attached = true
@calculateDimensions()
@hiddenInput.width(@charWidth)
@setMaxLineLength() if @softWrap
@focus() if @isFocused
@trigger 'editor-open', [this]
afterAttach: (onDom) ->
return if @attached or not onDom
@attached = true
@calculateDimensions()
@hiddenInput.width(@charWidth)
@setMaxLineLength() if @softWrap
@focus() if @isFocused
@trigger 'editor-open', [this]
rootView: ->
@parents('#root-view').view()

View File

@@ -26,7 +26,6 @@ class RootView extends View
initialize: ({ pathToOpen, projectPath, panesViewState }) ->
@on 'toggle-file-finder', => @toggleFileFinder()
@on 'show-console', => window.showConsole()
@one 'attach', => @focus()
@on 'focus', (e) =>
if @activeEditor()
@activeEditor().focus()
@@ -50,6 +49,9 @@ class RootView extends View
@deserializePanes(panesViewState) if panesViewState
afterAttach: (onDom) ->
@focus() if onDom
serialize: ->
projectPath: @project?.path
panesViewState: @serializePanes()