mirror of
https://github.com/tmux/tmux.git
synced 2025-03-31 20:58:47 +00:00
Two improvements to reflow from Balazs Kezes:
- Don't extend the line to full width on insert/delete character which means leaves extra spaces when reflowing. - Only mark a line wrapped when the cursor actually goes off the end, not on newlines which can be used for positioning.
This commit is contained in:
parent
c6129f9c09
commit
8f1302282b
@ -184,7 +184,7 @@ grid_view_insert_cells(struct grid *gd, u_int px, u_int py, u_int nx)
|
|||||||
px = grid_view_x(gd, px);
|
px = grid_view_x(gd, px);
|
||||||
py = grid_view_y(gd, py);
|
py = grid_view_y(gd, py);
|
||||||
|
|
||||||
sx = grid_view_x(gd, gd->sx);
|
sx = grid_view_x(gd, gd->linedata[py].cellsize);
|
||||||
|
|
||||||
if (px == sx - 1)
|
if (px == sx - 1)
|
||||||
grid_clear(gd, px, py, 1, 1);
|
grid_clear(gd, px, py, 1, 1);
|
||||||
@ -201,7 +201,7 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
|
|||||||
px = grid_view_x(gd, px);
|
px = grid_view_x(gd, px);
|
||||||
py = grid_view_y(gd, py);
|
py = grid_view_y(gd, py);
|
||||||
|
|
||||||
sx = grid_view_x(gd, gd->sx);
|
sx = grid_view_x(gd, gd->linedata[py].cellsize);
|
||||||
|
|
||||||
grid_move_cells(gd, px, px + nx, py, sx - px - nx);
|
grid_move_cells(gd, px, px + nx, py, sx - px - nx);
|
||||||
grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);
|
grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);
|
||||||
|
@ -795,8 +795,6 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped)
|
|||||||
gl = &s->grid->linedata[s->grid->hsize + s->cy];
|
gl = &s->grid->linedata[s->grid->hsize + s->cy];
|
||||||
if (wrapped)
|
if (wrapped)
|
||||||
gl->flags |= GRID_LINE_WRAPPED;
|
gl->flags |= GRID_LINE_WRAPPED;
|
||||||
else
|
|
||||||
gl->flags &= ~GRID_LINE_WRAPPED;
|
|
||||||
|
|
||||||
if (s->cy == s->rlower)
|
if (s->cy == s->rlower)
|
||||||
grid_view_scroll_region_up(s->grid, s->rupper, s->rlower);
|
grid_view_scroll_region_up(s->grid, s->rupper, s->rlower);
|
||||||
|
Loading…
Reference in New Issue
Block a user