fix capital letters not registering

This commit is contained in:
Crispy 2023-03-05 18:25:49 +01:00
parent 15beff91b3
commit b5b7022ee7
2 changed files with 8 additions and 3 deletions

View file

@ -116,10 +116,15 @@ impl Editor {
KeyCode::Esc => self.active = false,
KeyCode::Char(ch) => self.insert_char(ch),
KeyCode::Enter => self.insert_char('\n'),
KeyCode::Tab => self.insert_char('\t'),
KeyCode::Backspace => self.backspace(),
KeyCode::Delete => self.delete(),
_ => (),
},
KeyModifiers::SHIFT => match event.code {
KeyCode::Char(ch) => self.insert_char(ch.to_ascii_uppercase()),
_ => (),
},
KeyModifiers::CONTROL => match event.code {
KeyCode::Char('s') => self.save(),
KeyCode::Char('c') => self.copy(),

View file

@ -52,7 +52,7 @@ impl Navigator {
editors.push(editor);
}
} else {
editors.push(Editor::new_named(clipboard.clone(), arg))
editors.push(Editor::new_named(clipboard.clone(), arg));
}
}
if args.is_empty() {
@ -157,7 +157,7 @@ impl Navigator {
let i = self.selected - self.editors.len();
if i == 0 {
if let Some(parent) = self.path.parent() {
self.path = parent.to_owned()
self.path = parent.to_owned();
}
} else {
let path = &self.files[i];
@ -170,7 +170,7 @@ impl Navigator {
{
self.selected = self.editors.len();
self.editors.push(editor);
self.open_selected()
self.open_selected();
}
}
}