C-l should update window size.

Noticed this when splitting the screen in tmux.
This commit is contained in:
2025-11-27 14:00:07 -08:00
parent 9afd030b87
commit 5c2571eba7

12
main.c
View File

@@ -2393,7 +2393,9 @@ process_kcommand(int16_t c)
void void
process_normal(int16_t c) process_normal(int16_t c)
{ {
int reps = 0; int cols = 0;
int rows = 0;
int reps = 0;
/* C-u handling must be the very first thing */ /* C-u handling must be the very first thing */
if (c == CTRL_KEY('u')) { if (c == CTRL_KEY('u')) {
@@ -2449,6 +2451,12 @@ process_normal(int16_t c)
case CTRL_KEY('g'): case CTRL_KEY('g'):
break; break;
case CTRL_KEY('l'): case CTRL_KEY('l'):
if (get_winsz(&rows, &cols) == 0) {
editor.rows = rows;
editor.cols = cols;
} else {
editor_set_status("Couldn't update window size.");
}
display_refresh(); display_refresh();
break; break;
case CTRL_KEY('s'): case CTRL_KEY('s'):
@@ -3120,8 +3128,6 @@ main(int argc, char *argv[])
} }
lineno = atoi(lnarg); lineno = atoi(lnarg);
jump = 1; jump = 1;
fprintf(stderr, "fname: %s\nlnarg: %s\nlineno: %d\n",
fname, lnarg, lineno);
} }
if (fname != NULL) { if (fname != NULL) {