Skip to content
This repository was archived by the owner on Sep 8, 2018. It is now read-only.

Commit be15996

Browse files
committed
Implement getFilterKey
1 parent bea1069 commit be15996

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/diff-list-view.coffee

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ class DiffListView extends SelectListView
99
getEmptyMessage: ->
1010
'No diffs'
1111

12+
getFilterKey: ->
13+
'lineText'
14+
1215
attach: ->
1316
@storeFocusedElement()
1417
atom.workspaceView.appendToTop(this)
1518
@focusFilterEditor()
1619

17-
viewForItem: ({oldStart, newStart, oldLines, newLines}) ->
18-
bufferRow = if newStart > 0 then newStart - 1 else newStart
19-
lineText = @editor.lineForBufferRow(bufferRow) ? ''
20+
viewForItem: ({oldStart, newStart, oldLines, newLines, lineText}) ->
2021
$$ ->
2122
@li class: 'two-lines', =>
2223
@div lineText, class: 'primary-line'
2324
@div "-#{oldStart},#{oldLines} +#{newStart},#{newLines}", class: 'secondary-line'
2425

2526
populate: ->
2627
diffs = atom.project.getRepo()?.getLineDiffs(@editor.getPath(), @editor.getText()) ? []
28+
for diff in diffs
29+
bufferRow = if diff.newStart > 0 then diff.newStart - 1 else diff.newStart
30+
diff.lineText = @editor.lineForBufferRow(bufferRow) ? ''
2731
@setItems(diffs)
2832

2933
toggle: ->

0 commit comments

Comments
 (0)