Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Force code actions to be single line (#21409)

Stanislav Alekseevfee0624299fe
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 69383ceb820..2464ce84271 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1690,7 +1690,9 @@ impl CodeActionsMenu {
}),
)
// TASK: It would be good to make lsp_action.title a SharedString to avoid allocating here.
- .child(SharedString::from(action.lsp_action.title.clone()))
+ .child(SharedString::from(
+ action.lsp_action.title.replace("\n", ""),
+ ))
})
.when_some(action.as_task(), |this, task| {
this.on_mouse_down(
@@ -1707,7 +1709,7 @@ impl CodeActionsMenu {
}
}),
)
- .child(SharedString::from(task.resolved_label.clone()))
+ .child(SharedString::from(task.resolved_label.replace("\n", "")))
})
})
.collect()