mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: tmux: remove redundant event_del()/evtimer_del() Like xterm, ignore DL and EL outside the scroll region, GitHub issue 5754.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: screen-write.c,v 1.302 2026/10/16 07:59:06 nicm Exp $ */
|
||||
/* $OpenBSD: screen-write.c,v 1.303 2026/10/16 11:33:44 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -1633,39 +1633,12 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
|
||||
struct screen *s = ctx->s;
|
||||
struct grid *gd = s->grid;
|
||||
struct tty_ctx ttyctx;
|
||||
u_int sy = screen_size_y(s);
|
||||
|
||||
if (ny == 0)
|
||||
ny = 1;
|
||||
|
||||
if (s->cy < s->rupper || s->cy > s->rlower) {
|
||||
if (ny > sy - s->cy)
|
||||
ny = sy - s->cy;
|
||||
if (ny == 0)
|
||||
return;
|
||||
|
||||
screen_write_initctx(ctx, &ttyctx, 1, 1);
|
||||
ttyctx.bg = bg;
|
||||
|
||||
#ifdef ENABLE_IMAGES
|
||||
image_redraw_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy);
|
||||
#endif
|
||||
|
||||
grid_view_insert_lines(gd, s->cy, ny, bg);
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
ttyctx.n = ny;
|
||||
|
||||
if (!screen_write_should_draw_lines(ctx, s->cy, sy - s->cy))
|
||||
return;
|
||||
if (~ttyctx.flags & TTY_CTX_PANE_OBSCURED || ctx->wp == NULL) {
|
||||
tty_write(tty_cmd_insertline, &ttyctx);
|
||||
return;
|
||||
}
|
||||
|
||||
screen_write_redraw_pane(ctx, &ttyctx);
|
||||
if (s->cy < s->rupper || s->cy > s->rlower)
|
||||
return;
|
||||
}
|
||||
|
||||
if (ny > s->rlower + 1 - s->cy)
|
||||
ny = s->rlower + 1 - s->cy;
|
||||
@@ -1675,15 +1648,7 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
|
||||
screen_write_initctx(ctx, &ttyctx, 1, 1);
|
||||
ttyctx.bg = bg;
|
||||
|
||||
#ifdef ENABLE_IMAGES
|
||||
image_redraw_area(ctx, 0, s->cy, screen_size_x(s),
|
||||
s->rlower + 1 - s->cy);
|
||||
#endif
|
||||
|
||||
if (s->cy < s->rupper || s->cy > s->rlower)
|
||||
grid_view_insert_lines(gd, s->cy, ny, bg);
|
||||
else
|
||||
grid_view_insert_lines_region(gd, s->rlower, s->cy, ny, bg);
|
||||
grid_view_insert_lines_region(gd, s->rlower, s->cy, ny, bg);
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
ttyctx.n = ny;
|
||||
@@ -1705,40 +1670,13 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
|
||||
struct screen *s = ctx->s;
|
||||
struct grid *gd = s->grid;
|
||||
struct tty_ctx ttyctx;
|
||||
u_int sy = screen_size_y(s), ry;
|
||||
u_int ry;
|
||||
|
||||
if (ny == 0)
|
||||
ny = 1;
|
||||
|
||||
if (s->cy < s->rupper || s->cy > s->rlower) {
|
||||
if (ny > sy - s->cy)
|
||||
ny = sy - s->cy;
|
||||
if (ny == 0)
|
||||
return;
|
||||
|
||||
screen_write_initctx(ctx, &ttyctx, 1, 1);
|
||||
ttyctx.bg = bg;
|
||||
|
||||
#ifdef ENABLE_IMAGES
|
||||
image_redraw_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy);
|
||||
#endif
|
||||
|
||||
grid_view_delete_lines(gd, s->cy, ny, bg);
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
ttyctx.n = ny;
|
||||
|
||||
ry = s->rlower + 1 - s->rupper;
|
||||
if (!screen_write_should_draw_lines(ctx, s->rupper, ry))
|
||||
return;
|
||||
if (~ttyctx.flags & TTY_CTX_PANE_OBSCURED || ctx->wp == NULL) {
|
||||
tty_write(tty_cmd_deleteline, &ttyctx);
|
||||
return;
|
||||
}
|
||||
|
||||
screen_write_redraw_pane(ctx, &ttyctx);
|
||||
if (s->cy < s->rupper || s->cy > s->rlower)
|
||||
return;
|
||||
}
|
||||
|
||||
ry = s->rlower + 1 - s->cy;
|
||||
if (ny > ry)
|
||||
@@ -1749,14 +1687,7 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
|
||||
screen_write_initctx(ctx, &ttyctx, 1, 1);
|
||||
ttyctx.bg = bg;
|
||||
|
||||
#ifdef ENABLE_IMAGES
|
||||
image_redraw_area(ctx, 0, s->cy, screen_size_x(s), ry);
|
||||
#endif
|
||||
|
||||
if (s->cy < s->rupper || s->cy > s->rlower)
|
||||
grid_view_delete_lines(gd, s->cy, ny, bg);
|
||||
else
|
||||
grid_view_delete_lines_region(gd, s->rlower, s->cy, ny, bg);
|
||||
grid_view_delete_lines_region(gd, s->rlower, s->cy, ny, bg);
|
||||
|
||||
screen_write_collect_flush(ctx, 0, __func__);
|
||||
ttyctx.n = ny;
|
||||
|
||||
Reference in New Issue
Block a user