Skip to content

Commit 8e0d24d

Browse files
committed
undo rustfmt change to input_field
1 parent 4615f84 commit 8e0d24d

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/views/input_field.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ use {
44
crossterm::{
55
cursor,
66
event::{
7-
Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEvent, MouseEventKind,
7+
Event,
8+
KeyCode,
9+
KeyEvent,
10+
KeyModifiers,
11+
MouseButton,
12+
MouseEvent,
13+
MouseEventKind,
814
},
915
queue,
10-
style::{Attribute, Color, SetBackgroundColor},
16+
style::{
17+
Attribute,
18+
Color,
19+
SetBackgroundColor,
20+
},
1121
},
1222
*,
1323
},
14-
crokey::{key, KeyCombination, OneToThree},
24+
crokey::{OneToThree, KeyCombination, key},
1525
std::io::Write,
1626
};
1727

@@ -59,7 +69,7 @@ macro_rules! wrap_content_fun {
5969

6070
impl InputField {
6171
pub const ENTER: KeyCombination = key!(enter);
62-
pub const ALT_ENTER: KeyCombination = key!(alt - enter);
72+
pub const ALT_ENTER: KeyCombination = key!(alt-enter);
6373

6474
pub fn new(area: Area) -> Self {
6575
let focused_style = CompoundStyle::default();
@@ -272,7 +282,10 @@ impl InputField {
272282
/// of the input. If you want to totally handle events, you
273283
/// may call function like `put_char` and `del_char_left`
274284
/// directly.
275-
pub fn apply_key_combination<K: Into<KeyCombination>>(&mut self, key: K) -> bool {
285+
pub fn apply_key_combination<K: Into<KeyCombination>>(
286+
&mut self,
287+
key: K,
288+
) -> bool {
276289
if !self.focused {
277290
return false;
278291
}
@@ -418,9 +431,7 @@ impl InputField {
418431
pub fn apply_event(&mut self, event: &Event, is_double_click: bool) -> bool {
419432
match event {
420433
Event::Mouse(mouse_event) => self.apply_mouse_event(*mouse_event, is_double_click),
421-
Event::Key(KeyEvent {
422-
code, modifiers, ..
423-
}) if self.focused => {
434+
Event::Key(KeyEvent { code, modifiers, .. }) if self.focused => {
424435
if modifiers.is_empty() {
425436
self.apply_keycode_event(*code, false)
426437
} else if *modifiers == KeyModifiers::SHIFT {

0 commit comments

Comments
 (0)