On Wednesday, May 6, 2020 at 12:51:50 PM UTC+2, Edward K. Ream wrote:
>
> On Sunday, May 3, 2020 at 4:11:48 PM UTC-5, vitalije wrote:
>
> in this prototype all those outline operations are made at the same time 
>> in both tree widget data-model and in v-nodes. This eliminates need for 
>> synchronization between these two models. No need for c.redraw_after..., 
>> c.redraw, c.redraw_later,... No need for several locks, for checking if the 
>> selected position is visible or not, is it outside hoist/chapter,...
>>
>
> I'm not sure what I think about this plan. How do you propose to handle 
> outline operations initiated from scripts?
>
> In the "real" Leo, scripts can update the outline (both model and view) in 
> one of two ways:
>
> 1. Call methods such as c.clone. These Commands methods call c.redraw 
> "automatically".
>
> 2. Call methods, such as p.clone. These Position methods don't call 
> c.redraw. The script must then c.redraw explicitly.
>
> I don't mind if c.redraw becomes a do-nothing. I just want to know how 
> it's going to work.
>
> Edward
>


For outline modifications initiated by scripts we will have to redraw the 
outline. To make it quick I plan to use diff algorithm similar to one I 
wrote earlier in the tree-refresh branch.

I would still recommend that p.clone and other methods for model 
modifications get redirected to tree.clone_node, tree.move_node_up,... and 
others. They will automatically update view. This updates should be quite 
fast and no need to distinguish them from pure model modifications. This 
screen updates can be prevented by using tree.blockSignlas if necessary.

The only way to modify the outline that we can't really control is when 
scripts use only v-nodes for making direct links like 
parent_v.children.append(child) or similar. For those modifications we need 
to redraw the tree after each script execution.

All modifications from the Leo core, should be just redirected to their 
doubles implemented in tree (c.clone -> tree.clone_node, c.moveOutlineUp -> 
tree.move_node_up, ...)

Vitalije

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ca69e901-ba1c-45eb-8b2a-0ad6020e038e%40googlegroups.com.

Reply via email to