mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
When copying, create selections marker layer on the *new* display layer
Previously, we were copying the selections marker layer into the current editor’s display layer. This would work fine until the spatial mapping drifted in the copied editor, and would then have counterintuitive results.
This commit is contained in:
@@ -591,14 +591,15 @@ class TextEditor extends Model
|
||||
|
||||
# Create an {TextEditor} with its initial state based on this object
|
||||
copy: ->
|
||||
selectionsMarkerLayer = @getMarkerLayer(@buffer.getMarkerLayer(@selectionsMarkerLayer.id).copy().id)
|
||||
displayLayer = @displayLayer.copy()
|
||||
selectionsMarkerLayer = displayLayer.getMarkerLayer(@buffer.getMarkerLayer(@selectionsMarkerLayer.id).copy().id)
|
||||
softTabs = @getSoftTabs()
|
||||
newEditor = new TextEditor({
|
||||
@buffer, selectionsMarkerLayer, @tabLength, softTabs,
|
||||
suppressCursorCreation: true, @config, @notificationManager, @packageManager,
|
||||
@firstVisibleScreenRow, @firstVisibleScreenColumn,
|
||||
@clipboard, @viewRegistry, @grammarRegistry, @project, @assert, @applicationDelegate,
|
||||
displayLayer: @buffer.copyDisplayLayer(@displayLayer.id)
|
||||
displayLayer
|
||||
})
|
||||
newEditor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user