Skip to content

Commit

Permalink
remove refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Dec 3, 2024
1 parent 340ca0c commit 08ea59a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions crates/vim/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,15 @@ impl Object {
TextObject::InsideFunction
},
),
Object::Comment => comment_object(map, relative_to),
Object::Comment => text_object(
map,
relative_to,
if around {
TextObject::AroundComment
} else {
TextObject::InsideComment
},
),
Object::Class => text_object(
map,
relative_to,
Expand Down Expand Up @@ -496,16 +504,6 @@ fn around_next_word(
Some(start..end)
}

fn comment_object(
map: &DisplaySnapshot,
relative_to: DisplayPoint,
target: TextObject,
) -> Option<Range<DisplayPoint>> {
let snapshot = &map.buffer_snapshot;
let offset = relative_to.to_offset(map, Bias::Left);
snapshot.range_for_syntax_ancestor(range)
}

fn text_object(
map: &DisplaySnapshot,
relative_to: DisplayPoint,
Expand Down

0 comments on commit 08ea59a

Please sign in to comment.