Author Topic: _StreamMarkerSetTextColor  (Read 885 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
_StreamMarkerSetTextColor
« on: October 21, 2021, 08:38:34 PM »
There seems to be a new problem here - I don't remember seeing this in 25.0.2
In my SymHighlights code it allocates a color:

Code: [Select]
            m_ColorSymHighlight = _AllocColor((int)fg, g_ColorDefinitions[m_ColorDefIndex].m_rgb, F_INHERIT_FG_COLOR);
            say("_AllocColor index=" m_ColorSymHighlight ", m_ColorDefIndex="m_ColorDefIndex);

Then when highlighting a word:
Code: [Select]
                            int pos_marker = _StreamMarkerAdd( p_window_id, offset_highlight, length_Highlight, isRealOffset, 0, s_markertypeSymHighlight, '');
                            _StreamMarkerSetTextColor(pos_marker, colorIndex);
                            say("_StreamMarkerSetTextColor index=" colorIndex ", pos_marker="pos_marker);

The problem is that sometimes, the color doesn't update.
Everytime symtag_toggle_sym_highlight is called it changes the color being used. (It calls _FreeColor(), and _AllocColor() when doing this).

From the say() output, I can see that a different color from my color table is selected, but the actual color on screen doesn't change.

The index returned by _AllocColor() stays the same.


Highlighting a second word and cycling it works.

Then trying to cycle the color on the 1st word starts working.