1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Mode init needs to be fired with the mode on the list or it will not be

resized correctly.
This commit is contained in:
nicm 2019-03-18 15:25:36 +00:00
parent 71431f24a7
commit 610f37cff0
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: grid.c,v 1.89 2019/03/12 23:21:45 nicm Exp $ */
/* $OpenBSD: grid.c,v 1.90 2019/03/18 15:25:36 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -481,11 +481,10 @@ void
grid_get_cell(struct grid *gd, u_int px, u_int py, struct grid_cell *gc)
{
if (grid_check_y(gd, __func__, py) != 0 ||
px >= gd->linedata[py].cellsize) {
px >= gd->linedata[py].cellsize)
memcpy(gc, &grid_default_cell, sizeof *gc);
return;
}
return (grid_get_cell1(&gd->linedata[py], px, gc));
else
grid_get_cell1(&gd->linedata[py], px, gc);
}
/* Set cell at relative position. */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: window.c,v 1.222 2019/03/18 14:10:25 nicm Exp $ */
/* $OpenBSD: window.c,v 1.223 2019/03/18 15:25:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -1247,16 +1247,17 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
if (wme->mode == mode)
break;
}
if (wme != NULL)
if (wme != NULL) {
TAILQ_REMOVE(&wp->modes, wme, entry);
else {
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
} else {
wme = xcalloc(1, sizeof *wme);
wme->wp = wp;
wme->mode = mode;
wme->prefix = 1;
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wme->screen = wme->mode->init(wme, fs, args);
}
TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED);