I usually use the quicksearch.py to quickly get an idea for where things 
are, activating the "Show Parents" option gives more context to the search 
results.

I initially just used the search string "prior" and this gave me a ton of 
results, I looked through all of them and eventually I found that the 
search string "'prior'" (with the single quotes included) will produce a 
smaller subset of results you're looking for. 

Leo's GUI used to be based on Tk and it looks like Tk used "Prior" and 
"Next". Based on the nodes "k.defineTkNames" and "filter.char2tkName" 
(which you can search for directly) it looks like you can use 
"pageup"/"pgup"/"prior" and "pagedn"/"pgdown"/"next" to the same effect, 
and in some cases it looks like case is unimportant. I'd like to get a 
confirmation from Edward. 

I think at this point there is probably little hope of creating a single 
correct option for PageUp/PageDown because doing so would probably break 
people's keybindings. But it may be possible to "hide" all but one option.

As Edward alluded to, keybindings feel complex. This is probably an area of 
code that could use some eventual simplification and cleanup. My feeling is 
that 7+ years later any part of the code that is still referencing Tk 
should be flagged for cleanup. But beyond fixing bugs that prevent 
keybindings from functioning as expected it's probably lower priority. 

On Tuesday, February 21, 2017 at 3:29:30 PM UTC-5, jkn wrote:
>
>
>
> On Tuesday, February 21, 2017 at 6:49:15 PM UTC, john lunzer wrote:
>>
>> 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
>>
>>
> Hi John
>     this isn't related to the thread I started a couple of days ago, where 
> it seems that these key(stroke)s are actually 'Next' and 'Prev', rather 
> than PgDown and PgUp, is it?
>
> I tried to find where those names were defined in the code but failed  to 
> do so so far...
>
>     HTH
>     Jon N
>
>

-- 
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