Like Thomas, for me, using the up down keys (or any  arrow home/end pgup 
pgdn keys) with focus in the tree to navigate has always kept my focus in 
the tree. 

You may have a setting set to put focus in body upon navigation set up to 
True. (cant remember on top of my head which setting does that & I'm on my 
phone right now)

Félix
 
On Thursday, November 7, 2024 at 7:09:25 PM UTC-5 [email protected] wrote:

> Your change of focus isn't happening for me.  Neither using the arrow keys 
> nor running goto-next-visible changed the focus to the body.  Looking at 
> the code for the method c.endEditing.  c.endEditing() calls 
> qtree.endEditLabel(), and  that kicks out the headline editor but without 
> changing focus away from the tree:
>
> def endEditLabel(self) -> None:
>     """
>     Override LeoTree.endEditLabel.
>
>     Just end editing of the presently-selected QLineEdit!
>     This will trigger the editingFinished_callback defined in 
> createEditorForItem.
>     """
>     item = self.getCurrentItem()
>     if not item:
>         return
>     e = self.getTreeEditorForItem(item)
>     if not e:
>         return
>     # Trigger the end-editing event.
>     w = self.treeWidget
>     w.closeEditor(e, EndEditHint.NoHint)
>     w.setCurrentItem(item)
>
> So now someone has to figure out why you got different results from me. I 
> know nothing about the tree and its programming.
>
> On Thursday, November 7, 2024 at 5:24:07 PM UTC-5 jkn wrote:
>
> (I seem to be on a mild Leo roll at the moment...)
>
> The Up/Down arrow keys, when focus is in the tree, seem by default to be 
> bound to
>
> goto-prev-visible
> and
> goto-next-visible
>
> for navigating nodes. There are also similar commands
>
> goto-prev-node
> and
> goto-next-node
>
> There seem to be two differences between these sets of commands:
>
> 1) goto-X-visible navigates the tree "as seen". Whereas goto-X-node 
> expands nodes as the tree is traversed.
>
> Thus for most of the time. goto-X-visible makes most sense, I would think. 
> However:
>
> 2) goto-X-visible changes the focus to the body after running!
>
> This means that I can't press the Up key multiple times to move around in 
> the tree, and causes me to have to use the mouse.
>
> Is this intentional? It seems a bit weird. I would like a (core) command 
> that allowed me to navigate the visible nodes of a tree using the Up and 
> Down keys repeatedly. It doesn't seem unreasonable...
>
> I had a look at the code for the different commands. There is a reference 
> to 
>
>     c.endEditing    # 2011/05/28: A special case.
>
> But it is not clear to me that this is the cause of the difference.
>
> I am a bit surprised that I have not seen this mentioned before - does 
> everyone use the mouse, r something?
>
> Thanks, J^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 view this discussion visit 
https://groups.google.com/d/msgid/leo-editor/b6a5f8ee-1640-49da-b4bd-9ecff44f5c53n%40googlegroups.com.

Reply via email to