hoist/dehoist

34 views
Skip to first unread message

Félix

unread,
Jul 6, 2020, 6:53:25 PM7/6/20
to leo-editor
Hi Edward,

Another little question here, while trying to find a way to implement hoist/dehoist:

Would checking if hoistStack has lenght (is thruty), and using its top entry's "p" as a target (to return its children list) instead of the root node of the tree work?

I think so but I Just wanted to know if something else would popup in your head as a better solution... Thanks ! 
--
Félix

Félix

unread,
Jul 6, 2020, 8:10:44 PM7/6/20
to leo-editor
Just thought I'd add a little thing: 

If anyone who knows Leo's codebase wants to help with leoInteg, a nice little thing would be to go through the issues at your leisure, and comment if it rings a bell in relation to a 'helper function' in Leo that might do something in particular to accomplish what the feature/enhancement the issue itself is about.

Thanks!  :)

--
Félix 

Félix

unread,
Jul 7, 2020, 1:59:46 AM7/7/20
to leo-editor
Nevermind the hoist/de-hoist I've got it under control! :) works great with this: 

def getChildren(self, p_ap):
'''EMIT OUT list of children of a node'''
if p_ap:
w_p = self.ap_to_p(p_ap)
if w_p and w_p.hasChildren():
return self.outputPNodes(w_p.children())
else:
return self.outputPNodes([]) # default empty array
else:
if self.commander.hoistStack:
return self.outputPNodes([self.commander.hoistStack[-1].p])
else:
return self.outputPNodes(self.yieldAllRootChildren()) # this outputs all Root Children


I'll push this and all the new keyboard tree-navigation stuff after breakfast tomorrow :)
--
Félix

Edward K. Ream

unread,
Jul 7, 2020, 6:25:09 AM7/7/20
to leo-editor
On Mon, Jul 6, 2020 at 7:10 PM Félix <felix...@gmail.com> wrote:

> If anyone who knows Leo's codebase wants to help with leoInteg, a nice little thing would be to go through the issues at your leisure, and comment if it rings a bell in relation to a 'helper function' in Leo that might do something in particular to accomplish what the feature/enhancement the issue itself is about.

I've added the following to my internal to-do list:

Review leoInteg issues and comment if a 'helper function' in Leo  might help.

Edward

Edward K. Ream

unread,
Jul 7, 2020, 6:27:54 AM7/7/20
to leo-editor
On Tue, Jul 7, 2020 at 12:59 AM Félix <felix...@gmail.com> wrote:

Nevermind the hoist/de-hoist I've got it under control! :)

Glad to hear it.  Well done.

In a similar vein, I'm going to test an importer script (with Ctrl-B in leoInteg) and see what happens.

Edward

Edward K. Ream

unread,
Jul 7, 2020, 11:18:47 AM7/7/20
to leo-editor
On Tue, Jul 7, 2020 at 5:24 AM Edward K. Ream <edre...@gmail.com> wrote:

I've added the following to my internal to-do list:

Review leoInteg issues and comment if a 'helper function' in Leo  might help.

I have just created Leo issue #1613 for this.

Edward
Reply all
Reply to author
Forward
0 new messages