agent: Fix bug where wrong crease for @mention would be displayed (#28558)
Release Notes: - agent: Fix a bug where an inserted @mention did not show up as the one that was selected
This commit is contained in:
parent
c124838a73
commit
5757e352b0
2 changed files with 19 additions and 20 deletions
|
@ -509,14 +509,13 @@ fn recent_context_picker_entries(
|
|||
recent
|
||||
}
|
||||
|
||||
pub(crate) fn insert_crease_for_mention(
|
||||
pub(crate) fn insert_fold_for_mention(
|
||||
excerpt_id: ExcerptId,
|
||||
crease_start: text::Anchor,
|
||||
content_len: usize,
|
||||
crease_label: SharedString,
|
||||
crease_icon_path: SharedString,
|
||||
editor_entity: Entity<Editor>,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) {
|
||||
editor_entity.update(cx, |editor, cx| {
|
||||
|
@ -535,6 +534,7 @@ pub(crate) fn insert_crease_for_mention(
|
|||
crease_label,
|
||||
editor_entity.downgrade(),
|
||||
),
|
||||
merge_adjacent: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -548,8 +548,9 @@ pub(crate) fn insert_crease_for_mention(
|
|||
render_trailer,
|
||||
);
|
||||
|
||||
editor.insert_creases(vec![crease.clone()], cx);
|
||||
editor.fold_creases(vec![crease], false, window, cx);
|
||||
editor.display_map.update(cx, |display_map, cx| {
|
||||
display_map.fold(vec![crease], cx);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue