From 08ea59a80168057d286b666bb7982b84ee288255 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 3 Dec 2024 08:39:51 -0700 Subject: [PATCH] remove refactoring --- crates/vim/src/object.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/vim/src/object.rs b/crates/vim/src/object.rs index 9fbff923509bde..380acc896ac8c0 100644 --- a/crates/vim/src/object.rs +++ b/crates/vim/src/object.rs @@ -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, @@ -496,16 +504,6 @@ fn around_next_word( Some(start..end) } -fn comment_object( - map: &DisplaySnapshot, - relative_to: DisplayPoint, - target: TextObject, -) -> Option> { - 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,