Hi everyone,

    I'm still young to Ruby and I'd like to have some advice on choosing a
data structure to represent the 'styled text' of Scintilla edit control in
ruby.

    Styled text is a string, that for each character associate a style (a
single byte of data). A style indicate if the character is part of a
keyword, a comment, a string... A typical use of those information is, for
example, to implement smart-indentation: if the previous line begin with
'class' and the 'class' word has the keyword style (may be the other way,
search text that has keyword style, then match for class), then the current
line should be indented... You get the idea.

    Style are integer that range from 0 to 255. How would you represents
this with ruby ? An array of FixNum ?  Or should the style value be
converted in hexa to allow pattern matching (you get a string like
'00.00.02.01.'...)

    My current "solution" is to store the text as a separate string, and the
styles as a separate array of Fixnum, then use MatchingData to get the match
index.

    Does anyone have any suggestions ?
    Thanks in advance,
    Baptiste.
---
Baptiste Lepilleur <gaiacrtn / free.fr>
http://gaiacrtn.free.fr/