Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
supermaven: Fix crash when editing non-ASCII text (#19153)
张小白6986f081d030
diff --git a/crates/supermaven/src/supermaven.rs b/crates/supermaven/src/supermaven.rsindex 38e11a2300a..68a55504028 100644--- a/crates/supermaven/src/supermaven.rs+++ b/crates/supermaven/src/supermaven.rs@@ -217,11 +217,11 @@ fn find_relevant_completion<'a>(};let current_cursor_offset = cursor_position.to_offset(buffer);- let original_cursor_offset = state.prefix_offset;- if current_cursor_offset < original_cursor_offset {+ if current_cursor_offset < state.prefix_offset {continue;}+ let original_cursor_offset = buffer.clip_offset(state.prefix_offset, text::Bias::Left);let text_inserted_since_completion_request =buffer.text_for_range(original_cursor_offset..current_cursor_offset);let mut trimmed_completion = state_completion;