Remove dbg statements

This commit is contained in:
Piotr Osiewicz 2023-11-20 18:31:30 +01:00
parent c1f0ac30a0
commit ad38708ede

View file

@ -257,15 +257,12 @@ impl ToolbarItemView for BufferSearchBar {
if let Some(searchable_item_handle) = if let Some(searchable_item_handle) =
item.and_then(|item| item.to_searchable_item_handle(cx)) item.and_then(|item| item.to_searchable_item_handle(cx))
{ {
dbg!("Setting");
dbg!(searchable_item_handle.item_id());
let this = cx.view().downgrade(); let this = cx.view().downgrade();
searchable_item_handle searchable_item_handle
.subscribe_to_search_events( .subscribe_to_search_events(
cx, cx,
Box::new(move |search_event, cx| { Box::new(move |search_event, cx| {
dbg!(&search_event);
if let Some(this) = this.upgrade() { if let Some(this) = this.upgrade() {
this.update(cx, |this, cx| { this.update(cx, |this, cx| {
this.on_active_searchable_item_event(search_event, cx) this.on_active_searchable_item_event(search_event, cx)
@ -575,7 +572,6 @@ impl BufferSearchBar {
} }
fn select_next_match(&mut self, _: &SelectNextMatch, cx: &mut ViewContext<Self>) { fn select_next_match(&mut self, _: &SelectNextMatch, cx: &mut ViewContext<Self>) {
dbg!("Hey?");
self.select_match(Direction::Next, 1, cx); self.select_match(Direction::Next, 1, cx);
} }
@ -599,17 +595,14 @@ impl BufferSearchBar {
pub fn select_match(&mut self, direction: Direction, count: usize, cx: &mut ViewContext<Self>) { pub fn select_match(&mut self, direction: Direction, count: usize, cx: &mut ViewContext<Self>) {
if let Some(index) = self.active_match_index { if let Some(index) = self.active_match_index {
dbg!("Has index");
if let Some(searchable_item) = self.active_searchable_item.as_ref() { if let Some(searchable_item) = self.active_searchable_item.as_ref() {
dbg!("Has searchable item");
if let Some(matches) = self if let Some(matches) = self
.searchable_items_with_matches .searchable_items_with_matches
.get(&searchable_item.downgrade()) .get(&searchable_item.downgrade())
{ {
dbg!("Has matches");
let new_match_index = searchable_item let new_match_index = searchable_item
.match_index_for_direction(matches, index, direction, count, cx); .match_index_for_direction(matches, index, direction, count, cx);
dbg!(new_match_index);
searchable_item.update_matches(matches, cx); searchable_item.update_matches(matches, cx);
searchable_item.activate_match(new_match_index, matches, cx); searchable_item.activate_match(new_match_index, matches, cx);
} }
@ -652,7 +645,6 @@ impl BufferSearchBar {
} }
fn on_active_searchable_item_event(&mut self, event: &SearchEvent, cx: &mut ViewContext<Self>) { fn on_active_searchable_item_event(&mut self, event: &SearchEvent, cx: &mut ViewContext<Self>) {
dbg!(&event);
match event { match event {
SearchEvent::MatchesInvalidated => { SearchEvent::MatchesInvalidated => {
let _ = self.update_matches(cx); let _ = self.update_matches(cx);
@ -1266,7 +1258,6 @@ mod tests {
search_bar search_bar
}); });
dbg!("!");
window window
.update(cx, |_, cx| { .update(cx, |_, cx| {
search_bar.update(cx, |search_bar, cx| search_bar.search("a", None, cx)) search_bar.update(cx, |search_bar, cx| search_bar.search("a", None, cx))
@ -1274,7 +1265,6 @@ mod tests {
.unwrap() .unwrap()
.await .await
.unwrap(); .unwrap();
dbg!("?");
let initial_selections = window let initial_selections = window
.update(cx, |_, cx| { .update(cx, |_, cx| {
search_bar.update(cx, |search_bar, cx| { search_bar.update(cx, |search_bar, cx| {
@ -1322,7 +1312,7 @@ mod tests {
search_bar.update(cx, |this, cx| this.select_next_match(&SelectNextMatch, cx)); search_bar.update(cx, |this, cx| this.select_next_match(&SelectNextMatch, cx));
initial_selections initial_selections
}).unwrap(); }).unwrap();
dbg!("Hey");
window.update(cx, |_, cx| { window.update(cx, |_, cx| {
assert!( assert!(
editor.read(cx).is_focused(cx), editor.read(cx).is_focused(cx),
@ -1350,7 +1340,6 @@ mod tests {
search_bar.select_all_matches(&SelectAllMatches, cx); search_bar.select_all_matches(&SelectAllMatches, cx);
}); });
}); });
dbg!("Ey");
window.update(cx, |_, cx| { window.update(cx, |_, cx| {
assert!( assert!(
editor.read(cx).is_focused(cx), editor.read(cx).is_focused(cx),