aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 6eaa89aa..e54c7497 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -959,7 +959,8 @@ impl Editor {
fn _refresh(&mut self) {
let config = self.config();
for (view, _) in self.tree.views_mut() {
- let doc = &self.documents[&view.doc];
+ let doc = doc_mut!(self, &view.doc);
+ view.sync_changes(doc);
view.ensure_cursor_in_view(doc, config.scrolloff)
}
}
@@ -971,6 +972,7 @@ impl Editor {
let doc = doc_mut!(self, &doc_id);
doc.ensure_view_init(view.id);
+ view.sync_changes(doc);
align_view(doc, view, Align::Center);
}
@@ -1239,6 +1241,9 @@ impl Editor {
// within view
if prev_id != view_id {
self.mode = Mode::Normal;
+ let view = view_mut!(self, view_id);
+ let doc = doc_mut!(self, &view.doc);
+ view.sync_changes(doc);
self.ensure_cursor_in_view(view_id);
}
}