Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
language_tools: Fix buffer search keeping focusing when pressing enter in vim mode (#26266)
CharlesChen0823382f9f61519a
diff --git a/crates/language_tools/src/lsp_log.rs b/crates/language_tools/src/lsp_log.rsindex 62f9889a801..b956b7439d1 100644--- a/crates/language_tools/src/lsp_log.rs+++ b/crates/language_tools/src/lsp_log.rs@@ -3,8 +3,8 @@ use copilot::Copilot;use editor::{actions::MoveToEnd, scroll::Autoscroll, Editor, EditorEvent};use futures::{channel::mpsc, StreamExt};use gpui::{- actions, div, App, Context, Corner, Entity, EventEmitter, FocusHandle, Focusable, IntoElement,- ParentElement, Render, Styled, Subscription, WeakEntity, Window,+ actions, div, AnyView, App, Context, Corner, Entity, EventEmitter, FocusHandle, Focusable,+ IntoElement, ParentElement, Render, Styled, Subscription, WeakEntity, Window,};use language::{language_settings::SoftWrap, LanguageServerId};use lsp::{@@ -12,7 +12,7 @@ use lsp::{SetTraceParams, TraceValue,};use project::{search::SearchQuery, Project, WorktreeId};-use std::{borrow::Cow, sync::Arc};+use std::{any::TypeId, borrow::Cow, sync::Arc};use ui::{prelude::*, Button, Checkbox, ContextMenu, Label, PopoverMenu, ToggleState};use workspace::{item::{Item, ItemHandle},@@ -1071,6 +1071,21 @@ impl Item for LspLogView {Some(Box::new(handle.clone()))}+ fn act_as_type<'a>(+ &'a self,+ type_id: TypeId,+ self_handle: &'a Entity<Self>,+ _: &'a App,+ ) -> Option<AnyView> {+ if type_id == TypeId::of::<Self>() {+ Some(self_handle.to_any())+ } else if type_id == TypeId::of::<Editor>() {+ Some(self.editor.to_any())+ } else {+ None+ }+ }+fn clone_on_split(&self,_workspace_id: Option<WorkspaceId>,