Skip to content

Issue with style generation. #21

Description

@rolesen

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()
    );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions