commit 719bf8df4840c027c628015e3f130e6a853e203f
parent b3e7ae719ae854f09dab7891d80092266e5775ec
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Sun, 16 Nov 2025 17:04:41 +0530
Exit content window on screen resize
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/nnn.c b/src/nnn.c
@@ -4883,7 +4883,8 @@ static bool show_content_in_floating_window(char *content, size_t content_len, e
int scroll_offset = 0;
int hscroll_offset = 0; /* Horizontal scroll offset */
int max_line_width = 0; /* Maximum line width in content */
- int ch;
+ int ret;
+ wint_t ch;
bool done = FALSE;
/* Calculate maximum line width */
@@ -4967,7 +4968,10 @@ static bool show_content_in_floating_window(char *content, size_t content_len, e
wrefresh(win);
/* Get user input from window */
- ch = wgetch(win);
+ ret = get_wch(&ch);
+ if (ret == ERR)
+ continue;
+
switch (ch) {
case 'q':
case ESC:
@@ -5010,6 +5014,11 @@ static bool show_content_in_floating_window(char *content, size_t content_len, e
hscroll_offset = MIN(max_line_width - max_display_width,
hscroll_offset + 10);
break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ done = TRUE;
+ break;
+#endif
}
}