Skip to content

Commit 2feadd3

Browse files
committed
Rename Edit.clear to reset and reset readonly
1 parent 63bdfb3 commit 2feadd3

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/core/src/components/edit/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ impl Edit {
8282
self.editable_line.set_content(content);
8383
}
8484

85-
pub(crate) fn clear(&mut self) {
85+
pub(crate) fn reset(&mut self) {
8686
self.editable_line.clear();
87+
self.editable_line.set_read_only(false);
8788
self.finished = false;
8889
}
8990

src/core/src/components/edit/tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ fn set_get_content() {
6161
}
6262

6363
#[test]
64-
fn clear_content() {
64+
fn reset() {
6565
let mut module = Edit::new();
6666
module.set_content("abcd");
67-
module.clear();
67+
module.reset();
6868
assert_eq!(module.get_content(), "");
69+
assert!(!module.is_finished());
6970
}

src/core/src/modules/insert/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) struct Insert {
3434
impl Module for Insert {
3535
fn activate(&mut self, _: State) -> Results {
3636
self.state = InsertState::Prompt;
37-
self.edit.clear();
37+
self.edit.reset();
3838
Results::new()
3939
}
4040

0 commit comments

Comments
 (0)