On Sun, 28 Jul 2013 04:07:12 -0700 (PDT) Fidel Pérez <[email protected]> wrote:
> Hi: > Im checking for a function which will go to a node, as opposed to "select > it". I was completely baffled trying to work out what you were talking about, but now I understand. Create an outline with three top level nodes, A, B, and C In the body of node A, put nd = g.findNodeAnywhere(c, "C") c.selectPosition(nd) # c.redraw() g.es(len(c.getSelectedPositions())) Run (Ctrl-B) this node with and without the commenting out of the c.redraw(). Commented out, both nodes are selected as Fidel describes, and length of selected nodes is 2. c.redraw() active, the expected behavior is seen, only node C is selected after the code has run. Redraw shouldn't change node selection state, c.selectPosition() should leave only one selected node, and if anyone needs it, a new c.setSelectedPositions() could allow selection of multiple positions. So I think this is a minor bug, you could file a report. Cheers -Terry > *Reason:* > > > - If I select a node with c.selectPosition(Node), the outline will go to > that node, and select it, but *my previous node will still be selected* > > Checking: > > *LeoPyRef.leo#Code-->Core classes-->@file leoCommands.py-->class > commands-->Command handlers...-->Outline menu...-->Goto (Commands)* > * > * > There is no command that will go to a specific node, selecting it as an > absolute node as oposed to just selecting it and leaving the rest selected. > > My workaround is just to first deselect all selected positions then do the > goto(Desired node): > > for item in c.getSelectedPositions(): > > c.selectPosition(item) > > c.selectPosition(Node i want to go to) > > > But I would think that would be a good addition as a command and is as > basic as any other current goto function. I also know its not so important > but heck I wanted to post anyway just in case. > > > Cheers guys. > -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.
