TODO:

For 3.2 and later:
  - BiDi support !!!
  - code completion : some keyboard handling fixes including undo
  - export only selected text
  - repaint after pending events finished
  - fix replace so that when it wraps it only continues to the point that it originally started from

BiDi implementation overview:
- QTextLayout performs all of the geometry calculations and saves the information in QTextItems
- A layout item is assigned to each lineRange (memory management may need work here)
- The layout object is told of all points where style changes and splits qtextitems as required
- The paint text line function iterates over qtextitems, sets the right style, draws the text, and any additional decorations we wish for

BiDi Status:
- Layouting
  - mostly implemented for word wrap mode, not started for non-wrap mode
    - some problems with range() function?
  - style breaking complete
  - word wrap not playing nicely yet

- Painting
  - Basic text drawing and attributes done
  - Bugs with wrapped text and attribute painting, esp. background (? offsets)

- Cursor movement and translation ported over to QText* methods
  - some bugs with word wrapping and remembering x position

- Also added space symbol drawing, similar to tab symbol drawing
  - make configurable

Short-term todo list:
- repaint triggering rewrite
