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.

Fix edits not being reported when rewrapping

Antonio Scandurra1b07fd6a7066
diff --git a/crates/editor2/src/display_map/wrap_map.rs b/crates/editor2/src/display_map/wrap_map.rs
index 408142ae07d..5aeecbae978 100644
--- a/crates/editor2/src/display_map/wrap_map.rs
+++ b/crates/editor2/src/display_map/wrap_map.rs
@@ -162,7 +162,7 @@ impl WrapMap {
{
let tab_snapshot = new_snapshot.tab_snapshot.clone();
let range = TabPoint::zero()..tab_snapshot.max_point();
- let edits = new_snapshot
+ edits = new_snapshot
.update(
tab_snapshot,
&[TabEdit {
diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs
index cf48c3aa29a..666aa8478e6 100644
--- a/crates/editor2/src/element.rs
+++ b/crates/editor2/src/element.rs
@@ -1710,8 +1710,6 @@ impl EditorElement {
SoftWrap::Column(column) => editor_width.min(column as f32 * em_advance),
};
- dbg!(bounds.size.width, gutter_width, gutter_margin, overscroll.width, em_width, em_advance, wrap_width);
- println!("setting wrap width during paint: {wrap_width:?}");
if editor.set_wrap_width(Some(wrap_width), cx) {
editor.snapshot(cx)
} else {
@@ -4183,7 +4181,6 @@ fn compute_auto_height_layout(
let overscroll = size(em_width, px(0.));
let editor_width = text_width - gutter_margin - overscroll.width - em_width;
- println!("setting wrap width during layout: {editor_width:?}");
if editor.set_wrap_width(Some(editor_width), cx) {
snapshot = editor.snapshot(cx);
}