summaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index c0cbc245..05ceb874 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -172,7 +172,7 @@ impl Application {
area,
theme_loader.clone(),
syn_loader.clone(),
- Box::new(Map::new(Arc::clone(&config), |config: &Config| {
+ Arc::new(Map::new(Arc::clone(&config), |config: &Config| {
&config.editor
})),
);
@@ -309,8 +309,10 @@ impl Application {
let surface = self.terminal.current_buffer_mut();
self.compositor.render(area, surface, &mut cx);
-
let (pos, kind) = self.compositor.cursor(area, &self.editor);
+ // reset cursor cache
+ self.editor.cursor_cache.set(None);
+
let pos = pos.map(|pos| (pos.col as u16, pos.row as u16));
self.terminal.draw(pos, kind).unwrap();
}
@@ -395,6 +397,13 @@ impl Application {
// Update all the relevant members in the editor after updating
// the configuration.
self.editor.refresh_config();
+
+ // reset view position in case softwrap was enabled/disabled
+ let scrolloff = self.editor.config().scrolloff;
+ for (view, _) in self.editor.tree.views_mut() {
+ let doc = &self.editor.documents[&view.doc];
+ view.ensure_cursor_in_view(doc, scrolloff)
+ }
}
/// refresh language config after config change