mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 15:55:33 +00:00
Fix bug with utf-8 extended characters not respecting visible range.
This commit is contained in:
@@ -2254,6 +2254,9 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
|||||||
if (selected)
|
if (selected)
|
||||||
skip = 0;
|
skip = 0;
|
||||||
|
|
||||||
|
/* xxx cache r in wp ? */
|
||||||
|
r = screen_redraw_get_visible_ranges(wp, s->cx, s->cy, width, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Move the cursor. If not wrapping, stick at the last character and
|
* Move the cursor. If not wrapping, stick at the last character and
|
||||||
* replace it.
|
* replace it.
|
||||||
@@ -2279,10 +2282,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
|||||||
memcpy(&tmp_gc, gc, sizeof tmp_gc);
|
memcpy(&tmp_gc, gc, sizeof tmp_gc);
|
||||||
ttyctx.cell = &tmp_gc;
|
ttyctx.cell = &tmp_gc;
|
||||||
ttyctx.num = redraw ? 2 : 0;
|
ttyctx.num = redraw ? 2 : 0;
|
||||||
/* xxx to be cached in wp */
|
for (i=0, vis=0; i < r->used; i++) vis += r->ranges[i].nx;
|
||||||
r = screen_redraw_get_visible_ranges(wp, s->cx, s->cy, width,
|
|
||||||
NULL);
|
|
||||||
for (i=0; i < r->used; i++) vis += r->ranges[i].nx;
|
|
||||||
if (vis < width) {
|
if (vis < width) {
|
||||||
/* Wide character or tab partly obscured. Write
|
/* Wide character or tab partly obscured. Write
|
||||||
* spaces one by one in unobscured region(s).
|
* spaces one by one in unobscured region(s).
|
||||||
@@ -2411,7 +2411,7 @@ screen_write_combine(struct screen_write_ctx *ctx, const struct grid_cell *gc)
|
|||||||
* could be an empty range in the visible ranges so we add them all up.
|
* could be an empty range in the visible ranges so we add them all up.
|
||||||
*/
|
*/
|
||||||
r = screen_redraw_get_visible_ranges(wp, cx - n, cy, n, NULL);
|
r = screen_redraw_get_visible_ranges(wp, cx - n, cy, n, NULL);
|
||||||
for (i=0; i < r->used; i++) vis += r->ranges[i].nx;
|
for (i=0, vis=0; i < r->used; i++) vis += r->ranges[i].nx;
|
||||||
if (vis < n) {
|
if (vis < n) {
|
||||||
/*
|
/*
|
||||||
* Part of this character is obscured. Return 1
|
* Part of this character is obscured. Return 1
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
|
|||||||
*/
|
*/
|
||||||
empty = 0;
|
empty = 0;
|
||||||
next_state = TTY_DRAW_LINE_DONE;
|
next_state = TTY_DRAW_LINE_DONE;
|
||||||
|
gcp = &grid_default_cell;
|
||||||
} else {
|
} else {
|
||||||
/* Get the current cell. */
|
/* Get the current cell. */
|
||||||
grid_view_get_cell(gd, px + i, py, &gc);
|
grid_view_get_cell(gd, px + i, py, &gc);
|
||||||
|
|||||||
Reference in New Issue
Block a user