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

Commit d1be2ac

Browse files
Corne DorrestijnCorne Dorrestijn
authored andcommitted
Added 'no results' and '1 result' to search dialog
1 parent e74934b commit d1be2ac

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/nls/root/strings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ define({
112112
// Find, Replace, Find in Files
113113
"SEARCH_REGEXP_INFO" : "Use /re/ syntax for regexp search",
114114
"FIND_RESULT_COUNT" : "{0} results",
115+
"FIND_RESULT_COUNT_SINGLE" : "1 result",
116+
"FIND_NO_RESULTS" : "No results",
115117
"WITH" : "With",
116118
"BUTTON_YES" : "Yes",
117119
"BUTTON_NO" : "No",

src/search/FindReplace.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,15 @@ define(function (require, exports, module) {
240240
cursor = getSearchCursor(cm, state.query, {line: cursor.to().line + 1, ch: 0});
241241
}
242242
}
243-
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultCount));
243+
244+
if (resultCount === 0) {
245+
$("#find-counter").text(StringUtils.format(Strings.FIND_NO_RESULTS));
246+
} else if (resultCount === 1) {
247+
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT_SINGLE));
248+
} else {
249+
$("#find-counter").text(StringUtils.format(Strings.FIND_RESULT_COUNT, resultCount));
250+
}
251+
244252
} else {
245253
$("#find-counter").text("");
246254
}

0 commit comments

Comments
 (0)