On Mon, 8 Sep 2014 13:00:06 -0700 (PDT) "Edward K. Ream" <[email protected]> wrote:
> On Monday, September 8, 2014 2:49:29 PM UTC-5, Terry wrote: > > > Basically we need the body editor to not be a singleton thing, and > > then > free_layout can do all kinds of things, including persistent multiple > editors. Sounds like Edward's looking into the possibilities again, > so fingers crossed. > > I'm not sure you understood my previous comments. There is no > conceivable way to have c know more about multiple body editors > directly. As far as c is concerned, there is one and only one body > editor. The alternative is unthinkable: all of Leo's core (including > all commands!) would suddenly have to be aware of multiple editors. > This must never happen, and won't happen. Sure - I was originally thinking c.frame.body.wrapper et al could just return the "first" body editor, and the others could just be managed by free_layout and the user. But your idea of having free_layout switch things in and out is probably a good and perhaps essential enhancement to get the most out of this. So, thinking aloud, Leo's concept of the "current" node is essentially the node selected in the tree (ignoring multiple selection, which doesn't really alter this anyway, as Qt always has a *single* "focused" tree node concept, even when others are selected). I think the previous discussion suggested an orthogonal arrangement where each body editor could be following or not following the current tree selection, and each body editor could cause or not cause the tree to select the body editor's node when the body editor gained focus. Obviously the first part's essential. I think the second part would be nice, for note taking etc., although it might be simpler to have the tree always follow focused body editor. Anyway, it occurs to me that we can start on opposite sides of the mountain and meet in the middle :-) I can approach things from the free_layout end with "fake" body editors that are just simple QTextEditors, no syntax coloring / Leo key handling, and then we can see what it takes to get LeoTextEditor or whatever the class is called to take their place. Hmm, when more than one body editor is pointing at the same node... which is probably not that useful but bound to happen... well, deal with that as it arises I guess, no need to get hung up on it. Cheers -Terry > So the free_layout code *must* change body editors without c knowing > anything about it. But to repeat: maybe this isn't so hard. Modulo > the work that free_layout presumably *already* does (or could do) > regarding switching panes, the only *additional* work that > free_layout would have to do is (carefully!) switch > c.frame.body.wrapper, c.frame.body.wrapper.widget and (probably) > c.frame.body.widget when switching body editors. > > Please feel free to ask questions if this isn't perfectly clear to > you. > > 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
