Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notcurses_at_yx() doesn't return EGC in cell->gcluster, only in return value #410

Closed
dankamongmen opened this issue Mar 21, 2020 · 1 comment
Assignees
Labels
C++ c++ wrappers documentation Improvements or additions to documentation enhancement New feature or request python python wrappers
Milestone

Comments

@dankamongmen
Copy link
Owner

notcurses_at_yx() faithfully reproduces the reflected EGC in its return value, but rather than duplicating it in the value-result cell, sets that cell's gcluster to 0. this seems rather niggardly. can we not afford the short-term duplication into the standard plane's egcpool? Maybe not, if this is used in some tight loop somewhere in the core, but I very much doubt that to be the case outside of notcurses_refresh().

If we decide we can't suffer this short-lived copy, that's cool, hack on, but in that case we ought instead of V-R on the cell, we ought V-R on an attrword and a channels. The annoying thing about the current situation is that if you go working with the cell, i.e. passing it to is_simple() etc., it's broken due to that 0'd gcluster. So that's gotta go.

@dankamongmen dankamongmen added the enhancement New feature or request label Mar 21, 2020
@dankamongmen dankamongmen added this to the 1.3.0 milestone Mar 21, 2020
@dankamongmen dankamongmen self-assigned this Mar 21, 2020
@dankamongmen
Copy link
Owner Author

notcurses_at_yx() has the following comment:

        egc = pool_egc_copy(&nc->pool, srccell);
        c->gcluster = 0; // otherwise cell_release() will blow up

and this makes sense--as opposed to ncplane_at_yx() (which does leave the EGC in ->gcluster), we don't have a good egcpool to stick this in. OK, fine.

In that case, eliminate notcurses_at_yx(), since it is surprising, and instead take the attrword and channels as value-results.

@dankamongmen dankamongmen added C++ c++ wrappers documentation Improvements or additions to documentation python python wrappers labels Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ c++ wrappers documentation Improvements or additions to documentation enhancement New feature or request python python wrappers
Projects
None yet
Development

No branches or pull requests

1 participant