On Sun, 22 Sep 2013 15:16:16 -0700 (PDT)
Fidel N <[email protected]> wrote:

> c.p.insertAfter()
> c.executeMinibufferCommand('goto-next-sibling')
> c.executeMinibufferCommand('move-outline-up')
> c.executeMinibufferCommand('edit-headline')
> c.redraw()  

It's interesting that I wouldn't think of using
executeMinibufferCommand, but in some ways the API is cleaner when you
do.  I'd so something like 

  nd = p.insertAfter()
  
  # nd.moveToThreadBack()... wait, that's not right...
  # some p.move* methods move the position, some move the node...
  
  # source browsing required to get this
  nd.moveToNthChildOf(p.parent(), p.childIndex()-1)
  
  # no idea what the method for entering edit mode is, read source
  c.editHeadline()
  
  c.redraw()

or more succinctly

  nd = p.insertAfter()
  nd.moveToNthChildOf(p.parent(), p.childIndex()-1)
  c.editHeadline()
  c.redraw()

so one line shorter, but it doesn't work for top level nodes...

So, executeMinibufferCommand really is a simpler, cleaner, approach in
some cases (undo not withstanding ;-)

Cheers -Terry

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

Reply via email to