mismatch between ansi codes and style runs at EOL

Posted by Fiendish on Sun 18 Dec 2016 02:58 AM — 7 posts, 25,506 views.

USA Global Moderator #0
It seems like it's not possible for style runs to have colored but empty styles (or, I'm guessing, vice versa?).
If the server sends "COLOR1 text COLOR2 text COLOR3" on a line, the third color gets lost when you try to work on the capture using style runs.
Any chance of getting empty colors added, or of getting raw ansi data passed to match functions? They affect the subsequent line.
Amended on Sun 18 Dec 2016 03:01 AM by Fiendish
Australia Forum Administrator #1
Maybe you are referring to this:


// adds text to a line, adds to current style run if possible
void CPaneLine::AddStyle (const CPaneStyle style)
    {
    // don't need to if no text in style  (maybe)
    if (style.m_sText.empty ())
      return;
...


paneline.cpp
USA Global Moderator #2
Looks about right. How do you feel about optionally definitely maybeing? :)
Amended on Sun 18 Dec 2016 03:36 AM by Fiendish
USA Global Moderator #3
Proposed.
https://github.com/nickgammon/mushclient/pull/28

I'm finding this to be a critical missing piece of trying to Simulate captured lines that are supposed to color bleed.
I don't know if this has no side effects, whereas passing a new raw ansi data field to the trigger scripts would be guaranteed free of side effects, but it seems to be working fine for me so far.
Amended on Mon 19 Dec 2016 02:00 AM by Fiendish
Australia Forum Administrator #4
You've tested it then?
USA Global Moderator #5
I've been testing since last night. It fixes my problem and doesn't seem to introduce new ones. I'm willing to bet that noone will ever loop through styles in a way that cares whether the last one has no text in it. At worst someone will have a final empty ColourTell, which is basically a noop.
Australia Forum Administrator #6
I think I found an empty style run anyway during some other testing so it probably doesn't matter much. I've merged your commit.