Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision 13277e3515519d3c89e00804818e98271fa776e9)
+++ uspace/app/edit/edit.c	(revision 3c22438add89eecf2847ebd7fb66d92bbdec0ea4)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2024 Jiri Svoboda
+ * Copyright (c) 2026 Jiri Svoboda
  * Copyright (c) 2012 Martin Sucha
  * All rights reserved.
@@ -240,4 +240,5 @@
 static void edit_ui_destroy(edit_t *);
 
+static void edit_wnd_resize(ui_window_t *, void *);
 static void edit_wnd_close(ui_window_t *, void *);
 static void edit_wnd_focus(ui_window_t *, void *, unsigned);
@@ -246,4 +247,5 @@
 
 static ui_window_cb_t edit_window_cb = {
+	.resize = edit_wnd_resize,
 	.close = edit_wnd_close,
 	.focus = edit_wnd_focus,
@@ -363,4 +365,43 @@
 	edit_ui_destroy(&edit);
 	return 0;
+}
+
+/** Set menu bar rectangle.
+ *
+ * Set the menu bar rectangle based on editor window dimensions.
+ * Used when window is created or resized.
+ *
+ * @param edit Editor
+ */
+static void edit_menubar_set_rect(edit_t *edit)
+{
+	gfx_rect_t arect;
+	gfx_rect_t rect;
+
+	ui_window_get_app_rect(edit->window, &arect);
+
+	rect.p0 = arect.p0;
+	rect.p1.x = arect.p1.x;
+	rect.p1.y = arect.p0.y + 1;
+	ui_menu_bar_set_rect(edit->menubar, &rect);
+}
+
+/** Set status bar rectangle.
+ *
+ * Set the status bar rectangle based on editor window dimensions.
+ * Used when window is created or resized.
+ *
+ * @param edit Editor
+ */
+static void edit_status_set_rect(edit_t *edit)
+{
+	gfx_rect_t arect;
+	gfx_rect_t rect;
+
+	ui_window_get_app_rect(edit->window, &arect);
+	rect.p0.x = arect.p0.x;
+	rect.p0.y = arect.p1.y - 1;
+	rect.p1 = arect.p1;
+	ui_label_set_rect(edit->status, &rect);
 }
 
@@ -395,6 +436,4 @@
 	ui_menu_entry_t *mssep = NULL;
 	ui_menu_entry_t *mgoto = NULL;
-	gfx_rect_t arect;
-	gfx_rect_t rect;
 
 	rc = ui_create(UI_CONSOLE_DEFAULT, &edit->ui);
@@ -582,10 +621,5 @@
 	ui_menu_entry_set_cb(mgoto, edit_search_go_to_line, (void *) edit);
 
-	ui_window_get_app_rect(edit->window, &arect);
-
-	rect.p0 = arect.p0;
-	rect.p1.x = arect.p1.x;
-	rect.p1.y = arect.p0.y + 1;
-	ui_menu_bar_set_rect(edit->menubar, &rect);
+	edit_menubar_set_rect(edit);
 
 	rc = ui_fixed_add(fixed, ui_menu_bar_ctl(edit->menubar));
@@ -613,8 +647,5 @@
 	}
 
-	rect.p0.x = arect.p0.x;
-	rect.p0.y = arect.p1.y - 1;
-	rect.p1 = arect.p1;
-	ui_label_set_rect(edit->status, &rect);
+	edit_status_set_rect(edit);
 
 	rc = ui_fixed_add(fixed, ui_label_ctl(edit->status));
@@ -1202,37 +1233,9 @@
 }
 
-/** Initialize pane.
- *
- * TODO: Replace with pane_create() that allocates the pane.
- *
- * @param window Editor window
- * @param pane Pane
- * @return EOK on success or an error code
- */
-static errno_t pane_init(ui_window_t *window, pane_t *pane)
-{
-	errno_t rc;
+static void pane_set_rect(pane_t *pane)
+{
 	gfx_rect_t arect;
 
-	pane->control = NULL;
-	pane->color = NULL;
-	pane->sel_color = NULL;
-
-	rc = ui_control_new(&pane_ctl_ops, (void *) pane, &pane->control);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x07, &pane->color);
-	if (rc != EOK)
-		goto error;
-
-	rc = gfx_color_new_ega(0x1e, &pane->sel_color);
-	if (rc != EOK)
-		goto error;
-
-	pane->res = ui_window_get_res(window);
-	pane->window = window;
-
-	ui_window_get_app_rect(window, &arect);
+	ui_window_get_app_rect(pane->window, &arect);
 	pane->rect.p0.x = arect.p0.x;
 	pane->rect.p0.y = arect.p0.y + 1;
@@ -1242,5 +1245,38 @@
 	pane->columns = pane->rect.p1.x - pane->rect.p0.x;
 	pane->rows = pane->rect.p1.y - pane->rect.p0.y;
-
+}
+
+/** Initialize pane.
+ *
+ * TODO: Replace with pane_create() that allocates the pane.
+ *
+ * @param window Editor window
+ * @param pane Pane
+ * @return EOK on success or an error code
+ */
+static errno_t pane_init(ui_window_t *window, pane_t *pane)
+{
+	errno_t rc;
+
+	pane->control = NULL;
+	pane->color = NULL;
+	pane->sel_color = NULL;
+
+	rc = ui_control_new(&pane_ctl_ops, (void *) pane, &pane->control);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_ega(0x07, &pane->color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_color_new_ega(0x1e, &pane->sel_color);
+	if (rc != EOK)
+		goto error;
+
+	pane->res = ui_window_get_res(window);
+	pane->window = window;
+
+	pane_set_rect(pane);
 	return EOK;
 error:
@@ -1256,4 +1292,14 @@
 
 	return rc;
+}
+
+static void pane_resize(pane_t *pane)
+{
+	pane_set_rect(pane);
+
+	/* Scroll in case cursor is now outside of the editor pane. */
+	caret_move_relative(0, 0, dir_before, true);
+
+	pane_caret_display(pane);
 }
 
@@ -2350,4 +2396,18 @@
 }
 
+/** Window was resized.
+ *
+ * @param window Window
+ * @param arg Argument (edit_t *)
+ */
+static void edit_wnd_resize(ui_window_t *window, void *arg)
+{
+	edit_t *edit = (edit_t *) arg;
+
+	edit_menubar_set_rect(edit);
+	edit_status_set_rect(edit);
+	pane_resize(&pane);
+}
+
 /** Window close request
  *
