Introduce custom fold placeholders (#12214)
This pull request replaces the static `⋯` character we used to insert when folding a range with a custom render function that return an `AnyElement`. We plan to use this in the assistant, but for now this should be behavior-preserving. Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev> Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
e0cfba43aa
commit
57d570c281
19 changed files with 774 additions and 437 deletions
|
@ -189,7 +189,7 @@ pub struct LanguageModelChoiceDelta {
|
|||
struct MessageMetadata {
|
||||
role: Role,
|
||||
status: MessageStatus,
|
||||
// todo!("delete this")
|
||||
// TODO: Delete this
|
||||
#[serde(skip)]
|
||||
ambient_context: AmbientContextSnapshot,
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ use crate::{
|
|||
use anyhow::{anyhow, Result};
|
||||
use client::telemetry::Telemetry;
|
||||
use collections::{hash_map, HashMap, HashSet, VecDeque};
|
||||
use editor::FoldPlaceholder;
|
||||
use editor::{
|
||||
actions::{FoldAt, MoveDown, MoveUp},
|
||||
display_map::{
|
||||
|
@ -34,7 +35,7 @@ use fs::Fs;
|
|||
use futures::StreamExt;
|
||||
use gpui::{
|
||||
canvas, div, point, relative, rems, uniform_list, Action, AnyElement, AnyView, AppContext,
|
||||
AsyncAppContext, AsyncWindowContext, AvailableSpace, ClipboardItem, Context, Entity,
|
||||
AsyncAppContext, AsyncWindowContext, AvailableSpace, ClipboardItem, Context, Empty, Entity,
|
||||
EventEmitter, FocusHandle, FocusableView, FontStyle, FontWeight, HighlightStyle,
|
||||
InteractiveElement, IntoElement, Model, ModelContext, ParentElement, Pixels, Render,
|
||||
SharedString, StatefulInteractiveElement, Styled, Subscription, Task, TextStyle,
|
||||
|
@ -2943,6 +2944,10 @@ impl ConversationEditor {
|
|||
.insert_flaps(
|
||||
[Flap::new(
|
||||
start..end,
|
||||
FoldPlaceholder {
|
||||
render: Arc::new(|_, _, _| Empty.into_any()),
|
||||
constrain_width: false,
|
||||
},
|
||||
render_slash_command_output_toggle,
|
||||
render_slash_command_output_trailer,
|
||||
)],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue