@@ -53,6 +53,8 @@ fn find_word_boundary(slice: RopeSlice, mut pos: usize, direction: Direction, lo
53pub enum TextObject {
53pub enum TextObject {
56+ /// Used for moving between objects.
58impl Display for TextObject {
60impl Display for TextObject {
@@ -60,6 +62,7 @@ impl Display for TextObject {
60 f.write_str(match self {
62 f.write_str(match self {
61 Self::Around => "around",
63 Self::Around => "around",
62 Self::Inside => "inside",
64 Self::Inside => "inside",
65+ Self::Movement => "movement",
@@ -104,6 +107,7 @@ pub fn textobject_word(
104 Range::new(word_start - whitespace_count_left, word_end)
107 Range::new(word_start - whitespace_count_left, word_end)
110+ TextObject::Movement => unreachable!(),
@@ -118,6 +122,7 @@ pub fn textobject_surround(
118 .map(|(anchor, head)| match textobject {
122 .map(|(anchor, head)| match textobject {
119 TextObject::Inside => Range::new(next_grapheme_boundary(slice, anchor), head),
123 TextObject::Inside => Range::new(next_grapheme_boundary(slice, anchor), head),
120 TextObject::Around => Range::new(anchor, next_grapheme_boundary(slice, head)),
124 TextObject::Around => Range::new(anchor, next_grapheme_boundary(slice, head)),
125+ TextObject::Movement => unreachable!(),
122 .unwrap_or(range)
127 .unwrap_or(range)