blocks poc: handle std coredump-free #645

dankamongmen/slickgoose
nick black 4 years ago
parent a3369d77a9
commit 1ffd871784
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -15,7 +15,8 @@ allglyphs(struct notcurses* nc, struct ncplane* column, int legendy){
// some of these cause major problems with Kitty, if not others, due to
// heavy duty beating on freetype FIXME reenable when reasonable
const int valid_planes[] = {
0, 1, /*2,*/ 3, 14, /*15, 16,*/ -1
0, 1, 2, 3, 14,
/*15, 16,*/ -1
};
struct ncplane* std = notcurses_stdplane(nc);
const int dimx = ncplane_dim_x(column);

@ -13,38 +13,40 @@ auto main() -> int {
notcurses_options nopts{};
nopts.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN;
NotCurses nc(nopts);
std::unique_ptr<Plane> n (nc.get_stdplane());
int dimx, dimy;
nc.get_term_dim(&dimy, &dimx);
{
std::unique_ptr<Plane> n (nc.get_stdplane());
int dimx, dimy;
nc.get_term_dim(&dimy, &dimx);
const int HEIGHT = 5;
const int WIDTH = 20;
auto na = std::make_unique<Plane>(n.get(), HEIGHT, WIDTH,
dimy - (HEIGHT + 1),
NCAlign::Center);
uint64_t channels = 0;
if(!na){
goto err;
}
n->set_fg(0x00ff00);
na->set_fg(0x00ff00);
if(!na->cursor_move(0, 0)){
goto err;
}
if(!na->rounded_box_sized(0, channels, HEIGHT, WIDTH, 0)){
goto err;
}
if(n->printf(0, 0, "arrrrp?") < 0){
goto err;
}
if(!n->rounded_box_sized(4, channels, HEIGHT, WIDTH, 0)){
goto err;
}
if(!nc.render()){
goto err;
const int HEIGHT = 5;
const int WIDTH = 20;
auto na = std::make_unique<Plane>(n.get(), HEIGHT, WIDTH,
dimy - (HEIGHT + 1),
NCAlign::Center);
uint64_t channels = 0;
if(!na){
goto err;
}
n->set_fg(0x00ff00);
na->set_fg(0x00ff00);
if(!na->cursor_move(0, 0)){
goto err;
}
if(!na->rounded_box_sized(0, channels, HEIGHT, WIDTH, 0)){
goto err;
}
if(n->printf(0, 0, "arrrrp?") < 0){
goto err;
}
if(!n->rounded_box_sized(4, channels, HEIGHT, WIDTH, 0)){
goto err;
}
if(!nc.render()){
goto err;
}
}
sleep(1);
return nc.stop() ? EXIT_FAILURE : EXIT_SUCCESS;
return nc.stop() ? EXIT_SUCCESS : EXIT_FAILURE;
err:
return EXIT_FAILURE;

Loading…
Cancel
Save