I've set these key shortcuts:

goto-next-n-visible   ! tree = PageDn
goto-prev-n-visible   ! tree = PageUp


Here is my @command goto-next-n-visible node:

@language python
N=12

def getVisNextN(n):
    current = c.p
    for ind in range(n):
        forward = current.getVisNext(c)
        if forward != None:
            current = forward
        else: break
    return current
    
NAhead = getVisNextN(N)

c.setCurrentPosition(NAhead)
c.redraw()

I think it's fairly straight forward, instead of the current behavior which 
just scrolls, this actually moves you down N number of nodes. This behavior 
makes more sense to me, but despite that feeling I don't have enough 
evidence to believe it should be default.

*Anyway*, this particular key shortcut does not work. Instead it pastes 
"PageDn" or "PageUp" in the body and places the cursor between the "P" and 
the "a".

Weird. I can confirm that the commands themselves work as expected as I 
previously had these commands bound to:

goto-next-n-visible         = Alt+UpArrow
goto-prev-n-visible         = Alt+DnArrow


And the behavior is as expected. 

Any ideas on why my new set of bindings is glitching?

Here is my version number:

Leo 5.4, build 20170221043749, Tue Feb 21 04:37:49 CST 2017
Git repo info: branch = master, commit = f860468937d5
Python 2.7.13, PyQt version 4.8.6
Windows 7 AMD64 (build 6.1.7601) SP1

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to