Fix #8464
This commit is contained in:
parent
8417e42d8b
commit
f57f3d9909
3 changed files with 12 additions and 11 deletions
|
|
@ -110,6 +110,9 @@ Detailed list of changes
|
|||
- Fix a regression in version 0.40.0 causing a crash when the underline
|
||||
thickness of the font is zero (:iss:`8443`)
|
||||
|
||||
- Fix a regression in version 0.40.0 causing a hang on resizing with a wide
|
||||
character at the right edge of a line that needs to be moved onto the next
|
||||
line (:iss:`8464`)
|
||||
|
||||
0.40.1 [2025-03-18]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ multiline_copy_src_to_dest(Rewrap *r) {
|
|||
|
||||
static void
|
||||
fast_copy_src_to_dest(Rewrap *r) {
|
||||
CPUCell *c; index_type mc_width;
|
||||
CPUCell *c;
|
||||
while (r->src.x < r->src_x_limit) {
|
||||
if (r->dest.x >= dest_xnum) {
|
||||
next_dest_line(r, true);
|
||||
|
|
@ -238,17 +238,10 @@ fast_copy_src_to_dest(Rewrap *r) {
|
|||
}
|
||||
}
|
||||
index_type num = MIN(r->src_x_limit - r->src.x, dest_xnum - r->dest.x);
|
||||
if (num && (c = &r->src.line.cpu_cells[r->src.x + num - 1])->is_multicell && c->x != (mc_width = mcd_x_limit(c)) - 1) {
|
||||
if (num && (c = &r->src.line.cpu_cells[r->src.x + num - 1])->is_multicell && c->x != mcd_x_limit(c) - 1) {
|
||||
// we have a split multicell at the right edge of the copy region
|
||||
if (num > mc_width) num = MIN(r->src_x_limit - r->src.x - mc_width, num);
|
||||
else {
|
||||
if (mc_width > dest_xnum) {
|
||||
multiline_copy_src_to_dest(r);
|
||||
return;
|
||||
}
|
||||
r->dest.x = dest_xnum;
|
||||
continue;
|
||||
}
|
||||
multiline_copy_src_to_dest(r);
|
||||
return;
|
||||
}
|
||||
copy_range(&r->src.line, r->src.x, &r->dest.line, r->dest.x, num);
|
||||
update_tracked_cursors(r, num, r->src.y, r->dest.y, r->src_x_limit);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,11 @@ def assert_line(text, y=None):
|
|||
def assert_cursor_at(x, y):
|
||||
self.ae((s.cursor.x, s.cursor.y), (x, y))
|
||||
|
||||
s = self.create_screen(cols=8, lines=4)
|
||||
s.draw('飛青進服三上')
|
||||
s.resize(s.lines, 5)
|
||||
self.ae('飛青', str(s.line(0)))
|
||||
|
||||
s = self.create_screen(cols=6, lines=6)
|
||||
|
||||
# Test basic multicell drawing
|
||||
|
|
|
|||
Loading…
Reference in a new issue