1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 14:26:17 +03:00

show 'match not found' error in search box title in editor example

Этот коммит содержится в:
rhysd
2022-07-08 12:08:38 +09:00
родитель dd409d6c4d
Коммит 5aa25ea24d

Просмотреть файл

@@ -266,7 +266,7 @@ impl<'a> Editor<'a> {
..
} => {
if !textarea.search_forward(false) {
self.message = Some("Pattern not found".into());
self.search.set_error(Some("Pattern not found"));
}
}
Input {
@@ -280,13 +280,15 @@ impl<'a> Editor<'a> {
..
} => {
if !textarea.search_back(false) {
self.message = Some("Pattern not found".into());
self.search.set_error(Some("Pattern not found"));
}
}
Input {
key: Key::Enter, ..
} => {
textarea.search_forward(true);
if !textarea.search_forward(true) {
self.message = Some("Pattern not found".into());
}
self.search.close();
textarea.set_search_pattern("").unwrap();
}