Enforce stricter requirements for Editor.getPane()

Previously it would return the closest '.pane' element
which would cause an editor inside of another editor
to report having a pane such as in the autocomplete view.
This commit is contained in:
Kevin Sawicki
2013-03-25 17:06:59 -04:00
parent 67adce6a99
commit 6f8c07e917
3 changed files with 9 additions and 9 deletions

View File

@@ -639,19 +639,19 @@ class Editor extends View
@requestDisplayUpdate()
splitLeft: (items...) ->
@pane()?.splitLeft(items...).activeView
@getPane()?.splitLeft(items...).activeView
splitRight: (items...) ->
@pane()?.splitRight(items...).activeView
@getPane()?.splitRight(items...).activeView
splitUp: (items...) ->
@pane()?.splitUp(items...).activeView
@getPane()?.splitUp(items...).activeView
splitDown: (items...) ->
@pane()?.splitDown(items...).activeView
@getPane()?.splitDown(items...).activeView
pane: ->
@closest('.pane').view()
getPane: ->
@parent('.item-views').parent('.pane').view()
remove: (selector, keepData) ->
return super if keepData or @removed

View File

@@ -41,7 +41,7 @@ module.exports =
goToMatchingPair: (editor) ->
return unless @pairHighlighted
return unless underlayer = editor.pane()?.find('.underlayer')
return unless underlayer = editor.getPane()?.find('.underlayer')
position = editor.getCursorBufferPosition()
previousPosition = position.translate([0, -1])
@@ -127,7 +127,7 @@ module.exports =
startPairPosition
updateMatch: (editor) ->
return unless underlayer = editor.pane()?.find('.underlayer')
return unless underlayer = editor.getPane()?.find('.underlayer')
@hideHighlightViews(editor) if @pairHighlighted
@pairHighlighted = false

View File

@@ -9,7 +9,7 @@ class StatusBarView extends View
@appendToEditorPane(rootView, editor) if editor.attached
@appendToEditorPane: (rootView, editor) ->
if pane = editor.pane()
if pane = editor.getPane()
pane.append(new StatusBarView(rootView, editor))
@content: ->