Changeset 11616

Jan 14, 2009, 9:21:56 AM (12 years ago)

When trying to deterine temporary attributes in
COMPUTE-TEMPORARY-ATTRIBUTES, use the #/bounds rectangle of the
enclosing scroll view's content view, not the #/frame rectangle.
(Note that COMPUTE-TEMPORARY-ATTRIBUTES is currently only called
on window activation and when the selection changes. That's
better than setting temporary attributes in the middle of drawRect:
(and causing excessive redisplay), but it means that we get no
highlighting when scrolling around the buffer.

I think that what we may want to do is:

  • update paren highlighting (only) when the selection changes.
  • parse the whole buffer (Hemlock-wise) when it's first opened.

Add temporary attributes (syntax highlighting) for "interesting"
ranges - currently strings and ;-comments, other things

  • whenever operations that modify the buffer complete (e.g., at

#/endEditing time) re-parses the affected range (and, in some
cases, preceding and succeeding lines.) Recompute temporary
attributes for what got re-parsed.

This would also mean that the buffer's always in a fully-parsed
state when a command runs, and that we're not affected by legacy
Hemlock limitations that try to guess how many surrounding toplevel
forms should be parsed.

I don't know if there are problems with this idea that make
it impractical, but I think that it makes more extent to explore
it than it does to try to (e.g.) intercept bounds-rectangle changes
and recompute temporary attributes while scrolling. (There might,
of course, be other approaches.)

1 edited


  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r11611 r11616  
    10321032         (scrollview (#/enclosingScrollView self))
    10331033         (contentview (if (%null-ptr-p scrollview) self (#/contentView scrollview)))
    1034          (rect (#/frame contentview))
     1034         (rect (#/bounds contentview))
    10351035         (layout (#/layoutManager container))
    10361036         (glyph-range (#/glyphRangeForBoundingRect:inTextContainer:
Note: See TracChangeset for help on using the changeset viewer.