Thanks, Edward for putting this code into the core as a command.

You interpreted SegundoBob's request differently, than I did. I was
thinking he didn't mind that the duplicates are there (and maybe prefers
it?), just that he wanted the displayed links go to the separate instances
of the clones.

SegundoBob, could you clarify?

On Mon, Oct 7, 2019 at 4:58 PM Edward K. Ream <[email protected]> wrote:

>
>
> On Monday, October 7, 2019 at 3:42:17 PM UTC-5, btheado wrote:
>>
>>
>> The short answer is that this is standard, core Leo code I'm calling. The
>> long answer is that it will take some investigation.
>>
>
> Here is the fix, at rev cc6c47b in devel:
>
> @g.command('show-clones')
> def show_clones(event=None):
>     """Display links to all parent nodes of the node c.p."""
>     c = event.get('c')
>     if not c:
>         return
>     seen = []
>     for clone in c.vnode2allPositions(c.p.v):
>         parent = clone.parent()
>         if parent and parent not in seen:
>             seen.append(parent)
>             g.es_clickable_link(c, clone, 1, f"{parent.h} -> {clone.h}\n")
>
> Note that the more pythonic: `for clone in
> list(set(c.vnode2allPositions(c.p.v)))` fails because positions are (on
> purpose) not hashable.
>
> Edward
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/leo-editor/5b3979ca-dc8a-482b-9698-691a304d7379%40googlegroups.com
> <https://groups.google.com/d/msgid/leo-editor/5b3979ca-dc8a-482b-9698-691a304d7379%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAO5X8CztAPVPMwfGXmsYNvGRQmC-agnrxYynpgpZPAunznrgZg%40mail.gmail.com.

Reply via email to