Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
🎨 fix linter errors, improve notification message
Browse files Browse the repository at this point in the history
  • Loading branch information
liuderchi committed Aug 5, 2016
1 parent 7b16cb3 commit fa6e29e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/project-find-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ProjectFindView extends View

copySearchResultFromPane: ->
atom.clipboard.write(Util.parseSearchResult())
atom.notifications.addInfo('Search results are copied to clipboard')
atom.notifications.addInfo('Search results have been copied to clipboard')

handleEventsForReplace: ->
@replaceEditor.getModel().getBuffer().onDidChange => @model.clearReplacementState()
Expand Down
14 changes: 7 additions & 7 deletions lib/project/util.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ module.exports =
else
"No #{if replacedPathCount? then 'more' else ''} results found for '#{@sanitizePattern(findPattern)}'"

parseSearchResult: () ->
parseSearchResult: ->
searchResult = []
summary = $('span.preview-count', 'div.preview-pane').text()
searchResult.push summary, ''

$('ol.results-view.list-tree>li.path').each () ->
path = $('span.path-name', @).text()
matches = $('span.path-match-number', @).text()
$('ol.results-view.list-tree>li.path').each ->
path = $('span.path-name', this).text()
matches = $('span.path-match-number', this).text()
searchResult.push path + ' ' + matches

$('li.search-result', @).filter(':visible').each () ->
lineNumber = $('span.line-number', @).text()
preview = $('span.preview', @).text()
$('li.search-result', this).filter(':visible').each ->
lineNumber = $('span.line-number', this).text()
preview = $('span.preview', this).text()
searchResult.push '\t' + lineNumber + '\t' + preview
searchResult.push ''
searchResult.join('\n')

0 comments on commit fa6e29e

Please sign in to comment.