Skip to content

Text select Color #148

Answered by magiblot
paule32 asked this question in Q&A
Discussion options

You must be logged in to vote

These hacks are no good. You only have two options:

  • To store styling information in a separate data structure, as you did in #151 (comment).
  • To decide everything while drawing the view in draw() (or maybe formatLine() in your case).

For example, the original TEditor simply applies the following logic:

  1. From the document's beginning to selStart, draw using the normal text color.
  2. From selStart to selEnd, draw using the selected text color.
  3. From selEnd to the document end (bufLen), draw using the normal text color again.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paule32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants