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

Issue with style generation. #21

Open
rolesen opened this issue Jan 24, 2021 · 1 comment
Open

Issue with style generation. #21

rolesen opened this issue Jan 24, 2021 · 1 comment

Comments

@rolesen
Copy link
Contributor

rolesen commented Jan 24, 2021

Hey, cool library for doing vt100 with a small footprint. Theres an issue with text style generation i encountered once stuff starts to get a bit more complicated than just a hello world.

Basicly, the main issue, I think, is with the toString() (or maybe with diff algos). I had bgMod or fgMod ending up with a "0" then it will reset basicly everything before that - even the background color just applied. defaultMod() can also write "0" but is less of an issue i guess.

A workaround seems to be: just specify both colors on all styles you use, then you don't run into it !

I tried to fix it naively, but found out the steps that have been taken to not reapply the same styles, etc. when writing out, and this complicates the matter.

The member function on "Style" we are talking about:


  std::string toString() const {
    return computeMod(
        defaultMod(),
        boldMod(),
        underlineMod(),
        faintMod(),
        italicMod(),
        hiddenMod(),
        crossedMod(),
        bgMod(),
        fgMod()
    );
@nikhedonia
Copy link
Contributor

Do you have some concrete examples how things fail?
I suspect that the diffing algorithm needs some attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants