Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ define({
// Find, Replace, Find in Files
"SEARCH_REGEXP_INFO" : "Use /re/ syntax for regexp search",
"FIND_RESULT_COUNT" : "{0} results",
"FIND_RESULT_COUNT_SINGLE" : "1 result",
"FIND_NO_RESULTS" : "No results",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong here. Make sure you're using spaces everywhere and not tab characters.

"WITH" : "With",
"BUTTON_YES" : "Yes",
"BUTTON_NO" : "No",
Expand Down
10 changes: 9 additions & 1 deletion src/search/FindReplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,15 @@ define(function (require, exports, module) {
cursor = getSearchCursor(cm, state.query, {line: cursor.to().line + 1, ch: 0});
}
}
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultCount));

if (resultCount === 0) {
$("#find-counter").text(StringUtils.format(Strings.FIND_NO_RESULTS));
} else if (resultCount === 1) {
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT_SINGLE));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need to use StringUtils.format on this 2 if.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @TomMalbran! Sorry I missed that in the original review...

} else {
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultCount));
}

} else {
$("#find-counter").text("");
}
Expand Down