Skip to content

Commit eec70b3

Browse files
committed
✨ feat: move cursor to end
1 parent 7d440f9 commit eec70b3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/components/textinput.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ impl TextInputComponent {
7979
}
8080
}
8181

82+
pub fn move_cursor_to_end(&mut self) {
83+
if let Some(ta) = &mut self.textarea {
84+
for _ in 0..100 {
85+
ta.move_cursor(CursorMove::Forward);
86+
}
87+
}
88+
}
89+
8290
///
8391
pub const fn with_input_type(
8492
mut self,

src/popups/commit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ impl CommitPopup {
9292

9393
pub fn set_msg(&mut self, msg: String) {
9494
self.input.set_text(msg);
95+
self.input.move_cursor_to_end();
9596
}
9697

9798
///

src/popups/conventional_commit.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ impl ConventionalCommitPopup {
417417
let list_height =
418418
height.saturating_sub(HEIGHT_BLOCK_MARGIN);
419419

420-
let a = self.query_results[0].more_info()[0].strings();
421-
assert!(a.0 != "");
422-
423420
let scroll_skip =
424421
self.selected_index.saturating_sub(list_height);
425422
let quick_shortcuts = self.quick_shortcuts();
@@ -679,6 +676,8 @@ impl Component for ConventionalCommitPopup {
679676
),
680677
);
681678
self.hide();
679+
self.selected_index = 0;
680+
self.seleted_commit_type = None;
682681
} else {
683682
self.seleted_commit_type = self
684683
.query_results

0 commit comments

Comments
 (0)