mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
Add Editor::selectionFlashDuration rather than magic number
This commit is contained in:
parent
e5f800ef35
commit
48b6c24882
@ -749,7 +749,7 @@ describe "EditorComponent", ->
|
||||
selectionNode = node.querySelector('.selection')
|
||||
expect(selectionNode.classList.contains('flash')).toBe true
|
||||
|
||||
advanceClock 500
|
||||
advanceClock editor.selectionFlashDuration
|
||||
expect(selectionNode.classList.contains('flash')).toBe false
|
||||
|
||||
editor.setSelectedBufferRange([[1, 5], [1, 7]], flash: true)
|
||||
|
@ -146,6 +146,7 @@ class Editor extends Model
|
||||
selections: null
|
||||
suppressSelectionMerging: false
|
||||
updateBatchDepth: 0
|
||||
selectionFlashDuration: 500
|
||||
|
||||
@delegatesMethods 'suggestedIndentForBufferRow', 'autoIndentBufferRow', 'autoIndentBufferRows',
|
||||
'autoDecreaseIndentForBufferRow', 'toggleLineCommentForBufferRow', 'toggleLineCommentsForBufferRows',
|
||||
|
@ -83,7 +83,7 @@ class Selection extends Model
|
||||
@cursor.needsAutoscroll = false if @needsAutoscroll?
|
||||
@marker.setBufferRange(bufferRange, options)
|
||||
@autoscroll() if @needsAutoscroll and @editor.manageScrollPosition
|
||||
@decoration.flash('flash', 500) if needsFlash
|
||||
@decoration.flash('flash', @editor.selectionFlashDuration) if needsFlash
|
||||
|
||||
# Public: Returns the starting and ending buffer rows the selection is
|
||||
# highlighting.
|
||||
|
Loading…
Reference in New Issue
Block a user