Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Home and End buttons
  • Loading branch information
murlakatamenka committed Aug 9, 2020
commit f2647244ce4636dcbc66452229b2fc8095e4182c
4 changes: 2 additions & 2 deletions src/handlers/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub fn handler(key: Key, app: &mut App) {
app.input_idx = word_start;
app.input_cursor_position -= deleted_len;
}
Key::Ctrl('e') => {
Key::End | Key::Ctrl('e') => {
app.input_idx = app.input.len();
let input_string: String = app.input.iter().collect();
app.input_cursor_position = UnicodeWidthStr::width(input_string.as_str())
.try_into()
.unwrap();
}
Key::Ctrl('a') => {
Key::Home | Key::Ctrl('a') => {
app.input_idx = 0;
app.input_cursor_position = 0;
}
Expand Down