mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
wrap matches in their own list
This commit is contained in:
@@ -40,14 +40,15 @@ class PreviewList extends ScrollView
|
||||
@li class: classes.join(' '), =>
|
||||
@span path
|
||||
@span "(#{ops.length})", class: 'path-match-number'
|
||||
for operation in ops
|
||||
{prefix, suffix, match, range} = operation.preview()
|
||||
@li 'data-index': operation.index, class: 'operation', =>
|
||||
@span range.start.row + 1, class: 'line-number'
|
||||
@span class: 'preview', =>
|
||||
@span prefix
|
||||
@span match, class: 'match'
|
||||
@span suffix
|
||||
@ul class: 'matches', =>
|
||||
for operation in ops
|
||||
{prefix, suffix, match, range} = operation.preview()
|
||||
@li 'data-index': operation.index, class: 'operation', =>
|
||||
@span range.start.row + 1, class: 'line-number'
|
||||
@span class: 'preview', =>
|
||||
@span prefix
|
||||
@span match, class: 'match'
|
||||
@span suffix
|
||||
|
||||
@setSelectedOperationIndex(0)
|
||||
@show()
|
||||
@@ -69,8 +70,8 @@ class PreviewList extends ScrollView
|
||||
setSelectedOperationIndex: (index, scrollToOperation=true) ->
|
||||
index = Math.max(0, index)
|
||||
index = Math.min(@operations.length - 1, index)
|
||||
@children(".selected").removeClass('selected')
|
||||
element = @children("li.operation:eq(#{index})")
|
||||
@find('li.selected').removeClass('selected')
|
||||
element = @find("ul.matches li.operation:eq(#{index})")
|
||||
element.addClass('selected')
|
||||
|
||||
if scrollToOperation
|
||||
|
||||
Reference in New Issue
Block a user