@@ -42,8 +42,8 @@ impl EditorView {
42 viewport.x + OFFSET,
42 viewport.x + OFFSET,
43 viewport.y,
43 viewport.y,
44 viewport.width - OFFSET,
44 viewport.width - OFFSET,
45− viewport.height - 2,
45+ viewport.height - 1,
46− ); // - 2 for statusline and prompt
46+ ); // - 1 for statusline
47 self.render_buffer(view, area, surface, theme, is_focused);
47 self.render_buffer(view, area, surface, theme, is_focused);
49 // clear with background color
49 // clear with background color
@@ -52,7 +52,7 @@ impl EditorView {
53 let area = Rect::new(
53 let area = Rect::new(
54 viewport.x,
54 viewport.x,
55− viewport.y + viewport.height - 2,
55+ viewport.y + viewport.height - 1,
56 viewport.width,
56 viewport.width,
@@ -301,9 +301,8 @@ impl Component for EditorView {
301 fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
301 fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
302 match event {
302 match event {
303 Event::Resize(width, height) => {
303 Event::Resize(width, height) => {
304− // TODO: simplistic ensure cursor in view for now
304+ // HAXX: offset the render area height by 1 to account for prompt/commandline
305− // TODO: loop over views
306− cx.editor.tree.resize(Rect::new(0, 0, width, height));
305+ cx.editor.tree.resize(Rect::new(0, 0, width, height - 1));
307 // TODO: restore view.ensure_cursor_in_view();
306 // TODO: restore view.ensure_cursor_in_view();
308 EventResult::Consumed(None)
307 EventResult::Consumed(None)
@@ -353,10 +352,11 @@ impl Component for EditorView {
356− fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
355+ fn render(&self, mut area: Rect, surface: &mut Surface, cx: &mut Context) {
357 // SAFETY: we cheat around the view_mut() borrow because it doesn't allow us to also borrow
356 // SAFETY: we cheat around the view_mut() borrow because it doesn't allow us to also borrow
358 // theme. Theme is immutable mutating view won't disrupt theme_ref.
357 // theme. Theme is immutable mutating view won't disrupt theme_ref.
359 let theme_ref = unsafe { &*(&cx.editor.theme as *const Theme) };
358 let theme_ref = unsafe { &*(&cx.editor.theme as *const Theme) };
360 for (view, is_focused) in cx.editor.tree.views() {
360 for (view, is_focused) in cx.editor.tree.views() {
361 // TODO: use parent area
361 // TODO: use parent area
362 self.render_view(view, view.area, surface, theme_ref, is_focused);
362 self.render_view(view, view.area, surface, theme_ref, is_focused);