Compare commits

...

2 Commits

Author SHA1 Message Date
Richard Feldman
171d1fdbd0 wip 3 2025-04-11 01:35:58 -04:00
Richard Feldman
5f20674bca wip 2 2025-04-11 01:33:13 -04:00

View File

@@ -17179,6 +17179,59 @@ impl Editor {
self.active_indent_guides_state.dirty = true;
self.refresh_active_diagnostics(cx);
self.refresh_code_actions(window, cx);
// Check if the edit occurred within a crease (like an @-mention)
if let Some(buffer) = buffer_edited {
// Get display snapshot for crease information
let display_snapshot = self.display_map.update(cx, |display_map, cx| {
display_map.snapshot(cx)
});
// Get multibuffer snapshot for reference
let multibuffer_snapshot = self.buffer.update(cx, |multi_buffer, cx| {
multi_buffer.snapshot(cx)
});
// Access the buffer that was edited
buffer.update(cx, |buffer, _| {
// Log that we're checking for edits within creases
let buffer_id = buffer.remote_id();
dbg!("Checking for edits in @-mentions (creases)", buffer_id);
// Try to find creases in the edited buffer
let mut found_crease = false;
// Check each row in the buffer for creases
for row_idx in 0..multibuffer_snapshot.len() as u32 {
let row = multi_buffer::MultiBufferRow(row_idx);
// Check if there's a crease at this row
if let Some(crease) = display_snapshot.crease_for_buffer_row(row) {
found_crease = true;
// Get crease range information
let crease_range = crease.range();
let crease_start = crease_range.start.to_point(&multibuffer_snapshot);
let crease_end = crease_range.end.to_point(&multibuffer_snapshot);
// Log that we found a crease - these are the @-mentions
dbg!("Found a crease (@-mention) in the buffer",
format!("Row: {}", row_idx),
format!("Range: {:?}..{:?}", crease_start, crease_end));
// Since we're in the buffer_edited event handler, an edit has just happened
// Log that this edit might have affected the crease
dbg!("Edit detected that might affect this @-mention");
}
}
if !found_crease {
// No creases found in this buffer
dbg!("No @-mentions (creases) found in the edited buffer");
}
});
}
if self.has_active_inline_completion() {
self.update_visible_inline_completion(window, cx);
}