mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Selection views update properly when selections are merged
This commit is contained in:
@@ -768,8 +768,19 @@ describe "Editor", ->
|
||||
expect(selectionView.regions.length).toBe 3
|
||||
expect(selectionView.find('.selection').length).toBe 3
|
||||
|
||||
describe "when a selection merges with another selection", ->
|
||||
it "removes the merged selection view", ->
|
||||
editSession = editor.activeEditSession
|
||||
editSession.setCursorScreenPosition([4, 10])
|
||||
editSession.selectToScreenPosition([5, 27])
|
||||
editSession.addCursorAtScreenPosition([3, 10])
|
||||
editSession.selectToScreenPosition([6, 27])
|
||||
|
||||
expect(editor.getSelectionViews().length).toBe 1
|
||||
expect(editor.find('.selection').length).toBe 3
|
||||
|
||||
describe "cursor rendering", ->
|
||||
|
||||
|
||||
|
||||
describe "when the cursor moves", ->
|
||||
charWidth = null
|
||||
|
||||
@@ -13,7 +13,7 @@ class SelectionView extends View
|
||||
initialize: ({@editor, @selection} = {}) ->
|
||||
@regions = []
|
||||
@selection.on 'change-screen-range', => @updateAppearance()
|
||||
@selection.on 'destroy', => @remove('ignore')
|
||||
@selection.on 'destroy', => @remove()
|
||||
@updateAppearance()
|
||||
|
||||
updateAppearance: ->
|
||||
|
||||
Reference in New Issue
Block a user