Rename cannot_go_* functions to cannot_move_*

To be more consistent with wording.
pull/154/head
sebashwa 2 years ago
parent 468611de70
commit 25d032319e

@ -37,11 +37,11 @@ impl Input {
self.cursor_position = 0; self.cursor_position = 0;
} }
fn cannot_go_left(&self) -> bool { fn cannot_move_left(&self) -> bool {
self.value.is_empty() || self.cursor_index == 0 || self.value_width() == 0 self.value.is_empty() || self.cursor_index == 0 || self.value_width() == 0
} }
fn cannot_go_right(&self) -> bool { fn cannot_move_right(&self) -> bool {
self.cursor_index == self.value.len() self.cursor_index == self.value.len()
} }
@ -106,7 +106,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Delete | Key::Backspace => { Key::Delete | Key::Backspace => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }
@ -116,7 +116,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Right | Key::Ctrl('f') => { Key::Right | Key::Ctrl('f') => {
if self.cannot_go_right() { if self.cannot_move_right() {
return (Some(key), false); return (Some(key), false);
} }
@ -126,7 +126,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Ctrl('e') => { Key::Ctrl('e') => {
if self.cannot_go_right() { if self.cannot_move_right() {
return (Some(key), false); return (Some(key), false);
} }
@ -135,7 +135,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Alt('f') => { Key::Alt('f') => {
if self.cannot_go_right() { if self.cannot_move_right() {
return (Some(key), false); return (Some(key), false);
} }
@ -145,7 +145,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Alt('d') => { Key::Alt('d') => {
if self.cannot_go_right() { if self.cannot_move_right() {
return (Some(key), false); return (Some(key), false);
} }
@ -154,7 +154,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Ctrl('d') => { Key::Ctrl('d') => {
if self.cannot_go_right() { if self.cannot_move_right() {
return (Some(key), false); return (Some(key), false);
} }
@ -162,7 +162,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Left | Key::Ctrl('b') => { Key::Left | Key::Ctrl('b') => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }
@ -173,7 +173,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Ctrl('a') => { Key::Ctrl('a') => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }
@ -182,7 +182,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Alt('b') => { Key::Alt('b') => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }
@ -192,7 +192,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::Ctrl('w') => { Key::Ctrl('w') => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }
@ -202,7 +202,7 @@ impl Input {
return (Some(key), true); return (Some(key), true);
} }
Key::AltBackspace => { Key::AltBackspace => {
if self.cannot_go_left() { if self.cannot_move_left() {
return (Some(key), false); return (Some(key), false);
} }

Loading…
Cancel
Save