| | 1 | To implement character properties, the line structure is augmented with a charprops-changes slot. |
| | 2 | If all the characters on the line have default properties, this slot will contain NIL. Otherwise, |
| | 3 | it will be an adjustable vector with a fill pointer which contains one or more charprops-change structures. |
| | 4 | |
| | 5 | A charprops-change structure contains an index, which is the character position at which the change takes |
| | 6 | effect, and a plist, which represents the properties of the run of characters following the index. The properties are |
| | 7 | in effect until the index of the next charprops-change, or to the end of the line. |
| | 8 | |
| | 9 | The properties of the other lines do not affect a given line at all. |
| | 10 | |
| | 11 | A line always starts with the default character properties. This means that the first change in |
| | 12 | a line's charprops-changes vector may not have an index of 0. For instance, if the first 5 characters of |
| | 13 | a line had default properties, and the rest of the line was in bold, the charprops change vector would look |
| | 14 | like |
| | 15 | {{{ |
| | 16 | #(#S(HI::CHARPROPS-CHANGE :INDEX 5 :PLIST (:FONT-WEIGHT :BOLD))) |
| | 17 | }}} |
| | 18 | Note that the run of characters is implicit at the beginning. This makes for some added complexity in |
| | 19 | the code that searches and manages the charprops-changes vector. |
| | 20 | |