mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: ->
|
||||
|
||||
Reference in New Issue
Block a user