[ncplane_dup] don't use ncplane_cursor_move_yx(), set cursor directly

This commit is contained in:
nick black 2021-11-28 08:14:11 -05:00
parent 6f90d20543
commit 549fcac603
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -706,10 +706,10 @@ ncplane* ncplane_dup(const ncplane* n, void* opaque){
return NULL;
}
memmove(newn->fb, n->fb, fbsize);
if(ncplane_cursor_move_yx(newn, n->y, n->x) < 0){
ncplane_destroy(newn);
return NULL;
}
// don't use ncplane_cursor_move_yx() here; the cursor could be in an
// invalid location, which will be disallowed, failing out.
newn->y = n->y;
newn->x = n->x;
newn->halign = n->halign;
newn->stylemask = ncplane_styles(n);
newn->channels = ncplane_channels(n);