2009/8/15 Jean-Philippe Bernardy <jeanphilippe.berna...@gmail.com>:
>
> Regarding this:
>
> -- TODO: Perhaps the BOS should be a Mark with Forward direction?
>
> It's the way it used to be... However don't think its foolproof
> either: if you paste some
> text which does not fit in the window, the point will fall out of the
> display, but the
> "snapping" algorithm might not detect it.
>
> In general, your solution to do a "point snap" right after a scroll
> operation is quite appealing,
> because it minimises the number of layouts. The main downside is that
> it requires calling-back
> the UI from the buffer code. I'd like to avoid setting a precedent
> like this, so that the buffer
> code remains "pure". E.g. it can be extracted as a library. On top of
> that, there is the issue that
> pango layout is in IO, and I don't think it's justified to wrap it in
> unsafePerformIO: pango "Layout"s
> are stateful objects.
>

Ok, so the EOF isn't a special case. I've changed refreshEditor to do
(in the pointFollowsWindow False case):

* layout with old BOS
* move screen to include cursor
* relayout if the BOS changed

Unfortunately this requires two layout calls when scrolling through a
file. But it will be fast for cursor movement that doesn't go outside
the screen.

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to