Fix soft-wrapping with fold creases (#28029)

Release Notes:

- Fixed a rendering bug that caused context in the agent to not wrap
properly.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Zed AI <ai+claude-3.7@zed.dev>
This commit is contained in:
Antonio Scandurra 2025-04-03 19:33:08 +02:00 committed by GitHub
parent ed3722023e
commit e123c4bced
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 456 additions and 128 deletions

View file

@ -58,7 +58,7 @@ use clock::ReplicaId;
use collections::{BTreeMap, HashMap, HashSet, VecDeque};
use convert_case::{Case, Casing};
use display_map::*;
pub use display_map::{DisplayPoint, FoldPlaceholder};
pub use display_map::{ChunkRenderer, ChunkRendererContext, DisplayPoint, FoldPlaceholder};
use editor_settings::GoToDefinitionFallback;
pub use editor_settings::{
CurrentLineHighlight, EditorSettings, HideMouseMode, ScrollBeyondLastLine, SearchSettings,
@ -15045,6 +15045,15 @@ impl Editor {
self.active_indent_guides_state.dirty = true;
}
pub fn update_fold_widths(
&mut self,
widths: impl IntoIterator<Item = (FoldId, Pixels)>,
cx: &mut Context<Self>,
) -> bool {
self.display_map
.update(cx, |map, cx| map.update_fold_widths(widths, cx))
}
pub fn default_fold_placeholder(&self, cx: &App) -> FoldPlaceholder {
self.display_map.read(cx).fold_placeholder.clone()
}