Question about mark/unmark

47 views
Skip to first unread message

Félix

unread,
Apr 28, 2020, 11:12:46 PM4/28/20
to leo-editor
While working on leoInteg this week I've noticed something while testing the mark/unmark commands and behaviours.

When using ctrl+m to mark or unmark, this dirties the node, while doing so via the (right-click) context menu it does not make the node dirty.

Is this difference desired? And sorry if this was addressed before!

Thanks in advance for any clarifications  :)
--
Félix

Edward K. Ream

unread,
Apr 29, 2020, 6:39:53 AM4/29/20
to leo-editor
On Tue, Apr 28, 2020 at 10:12 PM Félix <felix...@gmail.com> wrote:

When using ctrl+m to mark or unmark, this dirties the node, while doing so via the (right-click) context menu it does not make the node dirty.

Good catch. Rev 521d2ad in devel brings the context_menu plugin into alignment with the rest of Leo's core.

The node should be marked dirty. Otherwise Leo might not save the marked "bit" when quitting. Indeed, c.setMarked calls p.setDirty. Within Leo's core, all calls to p.setMarked/clearMarked are followed by a call to p.setDirty.

Note: having v.set/clearDirty set both the marked and dirty bits might seem to be a better solution, but that would likely be dead wrong, because v.set/clearDirty might be called on startup.

Edward

Félix

unread,
Apr 29, 2020, 2:47:36 PM4/29/20
to leo-editor
In case that's of any importance: I'm on Leo 6.1-final, master branch, build cfca6f348c

Félix

unread,
Apr 29, 2020, 4:44:11 PM4/29/20
to leo-editor
Also noticed irregular dirtying when moving child of a node up or down (not left right)
: Only the first movement dirties the node. Subsequent movements of other siblings under the same parent nodes will not get dirty if moved up/down. Just thought I'd inquire about this fact because I'm re-doing most of the internals of leoInteg right now and I'm inspecting carefully each mouse/user interaction

Thanks again for any insights about those behaviours! :)


On Wednesday, April 29, 2020 at 6:39:53 AM UTC-4, Edward K. Ream wrote:

Edward K. Ream

unread,
Apr 30, 2020, 6:28:33 AM4/30/20
to leo-editor
On Wed, Apr 29, 2020 at 3:44 PM Félix <felix...@gmail.com> wrote:
Also noticed irregular dirtying when moving child of a node up or down (not left right)

This is a different matter, and complicated.

We want to dirty a node only if one of it's direct children moves. More importantly, we must mark ancestor @<file> nodes dirty if anything will change in the corresponding external file.

Leo's core is supposed to handle all this, so the details should not be of great concern to leoInteg. Just trust that p.v.isDirty() is correct.

Edward
Reply all
Reply to author
Forward
0 new messages