зеркало из
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
Этот коммит содержится в:
@@ -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();
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user