clean up cursor movement actions
This commit is contained in:
+6
-6
@@ -146,7 +146,7 @@ impl Cursor {
|
||||
self.collapse();
|
||||
}
|
||||
|
||||
pub fn move_to_next_word(&mut self, max: usize) {
|
||||
pub fn move_next_word_start(&mut self, max: usize) {
|
||||
if self.head == max { return; }
|
||||
|
||||
if self.head.is_multiple_of(4) { // at the beginning of a word
|
||||
@@ -157,7 +157,7 @@ impl Cursor {
|
||||
self.collapse();
|
||||
}
|
||||
|
||||
pub fn move_to_next_end(&mut self, max: usize) {
|
||||
pub fn move_next_word_end(&mut self, max: usize) {
|
||||
if self.head == max { return; }
|
||||
|
||||
self.collapse();
|
||||
@@ -169,7 +169,7 @@ impl Cursor {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn move_to_previous_beginning(&mut self) {
|
||||
pub const fn move_previous_word_start(&mut self) {
|
||||
if self.head == 0 { return; }
|
||||
|
||||
self.collapse();
|
||||
@@ -181,7 +181,7 @@ impl Cursor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn extend_to_next_word(&mut self, max: usize) {
|
||||
pub fn extend_next_word_start(&mut self, max: usize) {
|
||||
if self.head == max { return; }
|
||||
|
||||
if self.head.is_multiple_of(4) { // at the beginning of a word
|
||||
@@ -191,7 +191,7 @@ impl Cursor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn extend_to_next_end(&mut self, max: usize) {
|
||||
pub fn extend_next_word_end(&mut self, max: usize) {
|
||||
if self.head == max { return; }
|
||||
|
||||
if self.head % 4 == 3 { // at the end of a word
|
||||
@@ -201,7 +201,7 @@ impl Cursor {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn extend_to_previous_beginning(&mut self) {
|
||||
pub const fn extend_previous_word_start(&mut self) {
|
||||
if self.head == 0 { return; }
|
||||
|
||||
if self.head.is_multiple_of(4) { // at the beginning of a word
|
||||
|
||||
Reference in New Issue
Block a user