That sound good, but sadly although I've used Leo off and on for 17 years or so, I've never tried the scripting capabilities. Yes, I know I'm missing out, but I'm worried that it would be so cool I'd start playing with it and not get other stuff done.. I'll look into one of these days...
But meanwhile, I realized, thanks to this discussion, that the right way to do this is just to add another Leo Vue directive: @sort. Took me 15 minutes, next will add sort based on params in the node content. Joe On Thursday, April 19, 2018 at 12:57:18 PM UTC-4, Edward K. Ream wrote: > > ​​ > On Thu, Apr 19, 2018 at 7:52 AM, Joe Orr <[email protected] <javascript:>> > wrote: > > Is there a way to move a bunch of nodes at once, like move all marked >> nodes up? >> > > ​No, there isn't. There have been numerous requests to support Qt's > ability to select multiple nodes at once, but there are conceptual and > practical problems in doing so. > > A script might be able to detect multiply-selected nodes and act > accordingly. But scripts must be *extremely *careful when altering > multiple nodes, because the positions of nodes change when they move. > > For reference, see c.deletePositionsInList. It's not for the faint of > heart. > > The basic problem is keeping track of to-be-moved nodes. This should work: > > - Unmark all nodes: c.clearAllMarked() > - Mark all the the to-be-moved nodes. p.v.setMarked() > - Move *one node at a time*. > - Unmark the just-moved node. p.v.clearMarked() > - Continue until no more marked nodes exist. > - Redraw the screen: c.redraw() > > You could also use the "visited" bit instead of the "marked" bit using > c.clearAllVisited(), p.v.setVisited(), and p.v.clearVisited() > > *Important*: the vnode methods are much faster than the position methods > because they don't redraw the screen. > > Clear? > > 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 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.
