clean up cursor movement actions

This commit is contained in:
alice pellerin
2026-03-21 00:21:22 -05:00
parent f81d220d93
commit e0b3bbe052
2 changed files with 32 additions and 174 deletions
+6 -6
View File
@@ -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