зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 07:55:50 +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) {
|
if !textarea.search_forward(false) {
|
||||||
self.message = Some("Pattern not found".into());
|
self.search.set_error(Some("Pattern not found"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Input {
|
Input {
|
||||||
@@ -280,13 +280,15 @@ impl<'a> Editor<'a> {
|
|||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
if !textarea.search_back(false) {
|
if !textarea.search_back(false) {
|
||||||
self.message = Some("Pattern not found".into());
|
self.search.set_error(Some("Pattern not found"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Input {
|
Input {
|
||||||
key: Key::Enter, ..
|
key: Key::Enter, ..
|
||||||
} => {
|
} => {
|
||||||
textarea.search_forward(true);
|
if !textarea.search_forward(true) {
|
||||||
|
self.message = Some("Pattern not found".into());
|
||||||
|
}
|
||||||
self.search.close();
|
self.search.close();
|
||||||
textarea.set_search_pattern("").unwrap();
|
textarea.set_search_pattern("").unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user