view: Reposition cursors on tree resize.

This commit is contained in:
Blaž Hrastnik 2021-02-26 15:53:19 +09:00
parent ad58286dc7
commit 6336c1da20
2 changed files with 1 additions and 1 deletions

View file

@ -350,7 +350,6 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
Event::Resize(width, height) => {
// HAXX: offset the render area height by 1 to account for prompt/commandline
cx.editor.tree.resize(Rect::new(0, 0, width, height - 1));
// TODO: restore view.ensure_cursor_in_view();
EventResult::Consumed(None)
}
Event::Key(event) => {

View file

@ -231,6 +231,7 @@ pub fn recalculate(&mut self) {
Content::View(view) => {
// debug!!("setting view area {:?}", area);
view.area = area;
view.ensure_cursor_in_view();
} // TODO: call f()
Content::Container(container) => {
// debug!!("setting container area {:?}", area);