mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Avoid temporarily clearing DisplayLayer params in TextEditor.copy
This commit is contained in:
@@ -114,9 +114,6 @@ class TextEditor extends Model
|
||||
throw error
|
||||
|
||||
state.buffer = state.tokenizedBuffer.buffer
|
||||
if state.displayLayer = state.buffer.getDisplayLayer(state.displayLayerId)
|
||||
state.selectionsMarkerLayer = state.displayLayer.getMarkerLayer(state.selectionsMarkerLayerId)
|
||||
|
||||
state.assert = atomEnvironment.assert.bind(atomEnvironment)
|
||||
editor = new this(state)
|
||||
if state.registered
|
||||
@@ -167,22 +164,24 @@ class TextEditor extends Model
|
||||
grammar, tabLength, @buffer, @largeFileMode, @assert
|
||||
})
|
||||
|
||||
displayLayerParams = {
|
||||
invisibles: @getInvisibles(),
|
||||
softWrapColumn: @getSoftWrapColumn(),
|
||||
showIndentGuides: not @isMini() and @doesShowIndentGuide(),
|
||||
atomicSoftTabs: params.atomicSoftTabs ? true,
|
||||
tabLength: tabLength,
|
||||
ratioForCharacter: @ratioForCharacter.bind(this),
|
||||
isWrapBoundary: isWrapBoundary,
|
||||
foldCharacter: ZERO_WIDTH_NBSP,
|
||||
softWrapHangingIndent: params.softWrapHangingIndentLength ? 0
|
||||
}
|
||||
unless @displayLayer?
|
||||
displayLayerParams = {
|
||||
invisibles: @getInvisibles(),
|
||||
softWrapColumn: @getSoftWrapColumn(),
|
||||
showIndentGuides: not @isMini() and @doesShowIndentGuide(),
|
||||
atomicSoftTabs: params.atomicSoftTabs ? true,
|
||||
tabLength: tabLength,
|
||||
ratioForCharacter: @ratioForCharacter.bind(this),
|
||||
isWrapBoundary: isWrapBoundary,
|
||||
foldCharacter: ZERO_WIDTH_NBSP,
|
||||
softWrapHangingIndent: params.softWrapHangingIndentLength ? 0
|
||||
}
|
||||
|
||||
if @displayLayer?
|
||||
@displayLayer.reset(displayLayerParams)
|
||||
else
|
||||
@displayLayer = @buffer.addDisplayLayer(displayLayerParams)
|
||||
if @displayLayer = @buffer.getDisplayLayer(params.displayLayerId)
|
||||
@displayLayer.reset(displayLayerParams)
|
||||
@selectionsMarkerLayer = @displayLayer.getMarkerLayer(params.selectionsMarkerLayerId)
|
||||
else
|
||||
@displayLayer = @buffer.addDisplayLayer(displayLayerParams)
|
||||
|
||||
@backgroundWorkHandle = requestIdleCallback(@doBackgroundWork)
|
||||
@disposables.add new Disposable =>
|
||||
|
||||
Reference in New Issue
Block a user