mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Update scroll position after layer dimensions
Calling updateLayerDimensions() may change the scroll position so restore the edit session's stored scroll positions after updateLayerDimensions() is called but store the scroll left and scroll top positions beforehand.
This commit is contained in:
@@ -846,10 +846,6 @@ class Editor extends View
|
||||
else
|
||||
element.removeClass('selected')
|
||||
|
||||
setScrollPositionFromActiveEditSession: ->
|
||||
@scrollTop(@activeEditSession.scrollTop ? 0)
|
||||
@scrollLeft(@activeEditSession.scrollLeft ? 0)
|
||||
|
||||
saveScrollPositionForActiveEditSession: ->
|
||||
if @attached
|
||||
@activeEditSession.setScrollTop(@scrollTop())
|
||||
@@ -1093,8 +1089,11 @@ class Editor extends View
|
||||
|
||||
@clearRenderedLines()
|
||||
@removeAllCursorAndSelectionViews()
|
||||
editSessionScrollTop = @activeEditSession.scrollTop ? 0
|
||||
editSessionScrollLeft = @activeEditSession.scrollLeft ? 0
|
||||
@updateLayerDimensions()
|
||||
@setScrollPositionFromActiveEditSession()
|
||||
@scrollTop(editSessionScrollTop)
|
||||
@scrollLeft(editSessionScrollLeft)
|
||||
@newCursors = @activeEditSession.getCursors()
|
||||
@newSelections = @activeEditSession.getSelections()
|
||||
@updateDisplay(suppressAutoScroll: true)
|
||||
|
||||
Reference in New Issue
Block a user