On Tue, Aug 19, 2014 at 8:16 PM, Brian Theado <brian.the...@gmail.com> wrote:
> A few years ago the page up/down functionality was a fixed number of
> lines. I looked into the QT cpp code and translated it to python and
> checked it in:
>
> https://github.com/leo-editor/leo-editor/commit/9401804f956c0eef31d2068450a21436e9939268

Whoops, that was an earlier commit which took a different approach.
Here is the commit which implements the port of the QT code to python:

https://github.com/leo-editor/leo-editor/commit/3f0dc96e7fe155692a06b08eb40be917a7f52e97

Here is a UNL to the code in question:

leo-editor/leo/core/LeoPyRef.leo#Code-->Qt gui-->@file
../plugins/qtGui.py--> << define text widget classes >>--> << define
LeoQTextEditWidget class >>-->leoMoveCursorHelper & helper
(LeoQTextEditWidget)-->pageUpDown

The code moves the cursor one line at a time until the total screen
distance moved is greater than or equal to the height of the body.
After that, it moves the scroll bar one page in the same direction the
cursor was moved.

So I'd be interested in hearing in what situation it breaks for you.

> 2) Where did the c.frame.body.bodyCtrl.linesPerPage() function come
> from? Did I just miss it when I made my change a few years ago?

The pageUpDown implementation will work even if some lines have
different height.  Not sure that ever happens, but linesPerPage will
not handle that case.

Brian

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to