[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEditor CLineInfo and _TextEditor_State seems wrong


Le 01/11/2026 à 11:02, Bruce Steers a écrit :
I just noticed what might be an issue...
If you look at _TextEditor_State.class
https://gitlab.com/gambas/gambas/-/blob/master/comp/src/ gb.form.editor/.src/_TextEditor_State.class?ref_type=heads <https:// gitlab.com/gambas/gambas/-/blob/master/comp/src/gb.form.editor/.src/ _TextEditor_State.class?ref_type=heads>

Then check out CLineInfo.class
https://gitlab.com/gambas/gambas/-/blob/master/comp/src/ gb.form.editor/.src/CLineInfo.class?ref_type=heads <https://gitlab.com/ gambas/gambas/-/blob/master/comp/src/gb.form.editor/.src/ CLineInfo.class?ref_type=heads>

the State class looks like this...

Public _State As CLineInfo

'' Return the initial highlighting state value.
Property Read State As Short
'' Return the initial highlighting tag value.
Property Read Tag As Short

Private Function State_Read() As Short

   If _State Then
     Return _State.State
   Else
     Return 0
   Endif

End

Private Function Tag_Read() As Short

   If _State Then Return _State.Tag

End

But looking at CLineInfo.class it has neither a Tag property or State

It has GetState() method  but no Tag property.

Does it need fixing ?  ;)

Respects
BruceS

Indeed. The _TextEditor_State is not used anymore, just by the deprecated _TextEditor_Line.InitialState property that now returns nothing.

Everything could be rewritten using the new highlighting state (an array of imbricated specific states), but the InitialState property is actually useless, so just returning 0 is State_Read() should be enough to fix.

We can't remove the properties because of backward compatibility. We just let them do nothing.

Regards,

--
Benoît Minisini.


References:
TextEditor CLineInfo and _TextEditor_State seems wrongBruce Steers <bsteers4@xxxxxxxxx>