mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	More invalidation of images.
This commit is contained in:
		@@ -712,6 +712,9 @@ screen_write_alignmenttest(struct screen_write_ctx *ctx)
 | 
				
			|||||||
	memcpy(&gc, &grid_default_cell, sizeof gc);
 | 
						memcpy(&gc, &grid_default_cell, sizeof gc);
 | 
				
			||||||
	utf8_set(&gc.data, 'E');
 | 
						utf8_set(&gc.data, 'E');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_free_all(s) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (yy = 0; yy < screen_size_y(s); yy++) {
 | 
						for (yy = 0; yy < screen_size_y(s); yy++) {
 | 
				
			||||||
		for (xx = 0; xx < screen_size_x(s); xx++)
 | 
							for (xx = 0; xx < screen_size_x(s); xx++)
 | 
				
			||||||
			grid_view_set_cell(s->grid, xx, yy, &gc);
 | 
								grid_view_set_cell(s->grid, xx, yy, &gc);
 | 
				
			||||||
@@ -746,6 +749,9 @@ screen_write_insertcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
 | 
				
			|||||||
	if (s->cx > screen_size_x(s) - 1)
 | 
						if (s->cx > screen_size_x(s) - 1)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -774,6 +780,9 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
 | 
				
			|||||||
	if (s->cx > screen_size_x(s) - 1)
 | 
						if (s->cx > screen_size_x(s) - 1)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -802,6 +811,9 @@ screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
 | 
				
			|||||||
	if (s->cx > screen_size_x(s) - 1)
 | 
						if (s->cx > screen_size_x(s) - 1)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -819,10 +831,14 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
 | 
				
			|||||||
	struct screen	*s = ctx->s;
 | 
						struct screen	*s = ctx->s;
 | 
				
			||||||
	struct grid	*gd = s->grid;
 | 
						struct grid	*gd = s->grid;
 | 
				
			||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
 | 
						u_int		 sy = screen_size_y(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ny == 0)
 | 
						if (ny == 0)
 | 
				
			||||||
		ny = 1;
 | 
							ny = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, sy - s->cy) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (s->cy < s->rupper || s->cy > s->rlower) {
 | 
						if (s->cy < s->rupper || s->cy > s->rlower) {
 | 
				
			||||||
		if (ny > screen_size_y(s) - s->cy)
 | 
							if (ny > screen_size_y(s) - s->cy)
 | 
				
			||||||
			ny = screen_size_y(s) - s->cy;
 | 
								ny = screen_size_y(s) - s->cy;
 | 
				
			||||||
@@ -865,13 +881,17 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
 | 
				
			|||||||
	struct screen	*s = ctx->s;
 | 
						struct screen	*s = ctx->s;
 | 
				
			||||||
	struct grid	*gd = s->grid;
 | 
						struct grid	*gd = s->grid;
 | 
				
			||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
 | 
						u_int		 sy = screen_size_y(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ny == 0)
 | 
						if (ny == 0)
 | 
				
			||||||
		ny = 1;
 | 
							ny = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, sy - s->cy) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (s->cy < s->rupper || s->cy > s->rlower) {
 | 
						if (s->cy < s->rupper || s->cy > s->rlower) {
 | 
				
			||||||
		if (ny > screen_size_y(s) - s->cy)
 | 
							if (ny > sy - s->cy)
 | 
				
			||||||
			ny = screen_size_y(s) - s->cy;
 | 
								ny = sy - s->cy;
 | 
				
			||||||
		if (ny == 0)
 | 
							if (ny == 0)
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -917,6 +937,9 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	if (gl->cellsize == 0 && COLOUR_DEFAULT(bg))
 | 
						if (gl->cellsize == 0 && COLOUR_DEFAULT(bg))
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -940,6 +963,9 @@ screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	if (s->cx > sx - 1 || (s->cx >= gl->cellsize && COLOUR_DEFAULT(bg)))
 | 
						if (s->cx > sx - 1 || (s->cx >= gl->cellsize && COLOUR_DEFAULT(bg)))
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -962,6 +988,9 @@ screen_write_clearstartofline(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (s->cx > sx - 1)
 | 
						if (s->cx > sx - 1)
 | 
				
			||||||
		grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
 | 
							grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@@ -1002,6 +1031,9 @@ screen_write_reverseindex(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	struct screen	*s = ctx->s;
 | 
						struct screen	*s = ctx->s;
 | 
				
			||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_free_all(s) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1147,6 +1179,9 @@ screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
	u_int		 sx = screen_size_x(s), sy = screen_size_y(s);
 | 
						u_int		 sx = screen_size_x(s), sy = screen_size_y(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, s->cy, sy - s->cy) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1172,6 +1207,9 @@ screen_write_clearstartofscreen(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
	u_int		 sx = screen_size_x(s);
 | 
						u_int		 sx = screen_size_x(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_check_line(s, 0, s->cy - 1) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1195,6 +1233,9 @@ screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg)
 | 
				
			|||||||
	struct tty_ctx	 ttyctx;
 | 
						struct tty_ctx	 ttyctx;
 | 
				
			||||||
	u_int		 sx = screen_size_x(s), sy = screen_size_y(s);
 | 
						u_int		 sx = screen_size_x(s), sy = screen_size_y(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (image_free_all(s) && ctx->wp != NULL)
 | 
				
			||||||
 | 
							ctx->wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	screen_write_initctx(ctx, &ttyctx);
 | 
						screen_write_initctx(ctx, &ttyctx);
 | 
				
			||||||
	ttyctx.bg = bg;
 | 
						ttyctx.bg = bg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user