undoing unmarks nodes

67 views
Skip to first unread message

Félix

unread,
Oct 3, 2020, 10:27:03 PM10/3/20
to leo-editor
using leo on latest devel branch: 

Marked nodes get unmarked when performing an undo operation in them... is this a real (known) bug someone else can reproduce, or i'm doing something silly that i'm not aware of?
--
Félix

Thomas Passin

unread,
Oct 3, 2020, 11:56:37 PM10/3/20
to leo-editor
I can confirm that a marked node gets unmarked by an undo operation for a change later than the change that marked the node.  I don't think that should happen.  I think that marking nodes should be undoable - if only because the marks get saved when the outline is saved, so they are a real change to the outline. But they should only be undone when the undo stack reaches the operation that marked them.

Alternatively, marks should just be left alone and not subject to undo.  But then there is the question of what a mark should mark if its original target goes away by an undo operation.

On a related topic, if you undo all changes to an outline, then the outline should no longer be flagged as dirty (no asterisk in the outlines tab, etc), but that isn't happening.

gar

unread,
Oct 5, 2020, 4:40:33 AM10/5/20
to leo-e...@googlegroups.com
I reported that long time ago. Actually I do observe that marks
disappear even w/o undo, sort of suddenly. Since I didnt use clones
for my @auto code files - I used marks intensively to quickly switch
btw various code-in-work nodes and was totally upset with how they do
behave. Again, just switching to another node may trigger disappear of
the mark. And something else (like editing another node) also may.
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/c756e77b-7ed5-4bf2-aa65-8feed2a7f14fo%40googlegroups.com.
>

Edward K. Ream

unread,
Oct 5, 2020, 11:37:50 AM10/5/20
to leo-editor
On Mon, Oct 5, 2020 at 3:40 AM gar <gar...@gmail.com> wrote:
I reported that long time ago. Actually I do observe that marks
disappear even w/o undo, sort of suddenly.

The new #1694 suggests a thorough review of the marked bits logic.

Edward

gar

unread,
Oct 8, 2020, 7:58:33 AM10/8/20
to leo-e...@googlegroups.com
Actually let my say a word about undo.
I feel very uncomfortable when undo unmarked nodes and remove clones. Actually when I started to use Leo I expected that there would be several undoes: for tree operations, for editors, for marks/clones etc.
Can anybody explain me why all the sorts of undoes are united?

пн, 5 окт. 2020 г. в 18:37, Edward K. Ream <edre...@gmail.com>:
--
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+...@googlegroups.com.

Thomas Passin

unread,
Oct 8, 2020, 8:35:15 AM10/8/20
to leo-editor
@gar: "Actually when I started to use Leo I expected that there would be several undoes: for tree operations, for editors, for marks/clones etc."

That sounds too complicated to me.  I would expect undo actions to happen in the (reverse) order that I did them in the first place, whether they were changes to the tree, body edits, or anything else.  It's when that doesn't happen that I get confused.  There should not be special cases, because they wold be too hard to keep in mind.

On Thursday, October 8, 2020 at 7:58:33 AM UTC-4, gar wrote:
Actually let my say a word about undo.
I feel very uncomfortable when undo unmarked nodes and remove clones. Actually when I started to use Leo I expected that there would be several undoes: for tree operations, for editors, for marks/clones etc.
Can anybody explain me why all the sorts of undoes are united?

пн, 5 окт. 2020 г. в 18:37, Edward K. Ream <edre...@gmail.com>:


On Mon, Oct 5, 2020 at 3:40 AM gar <gar...@gmail.com> wrote:
I reported that long time ago. Actually I do observe that marks
disappear even w/o undo, sort of suddenly.

The new #1694 suggests a thorough review of the marked bits logic.

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 leo-e...@googlegroups.com.

gar

unread,
Oct 8, 2020, 8:43:55 AM10/8/20
to leo-e...@googlegroups.com
I am VIMer, so I cannot imagine too complicated actions :-) I can see only different levels of simplicity

чт, 8 окт. 2020 г. в 15:35, Thomas Passin <tbp1...@gmail.com>:

Thomas Passin

unread,
Oct 8, 2020, 9:22:55 AM10/8/20
to leo-editor
I figured it must be VIM or emacs!

Félix

unread,
Oct 8, 2020, 9:56:15 AM10/8/20
to leo-editor
Undos are ok being simply "one operation undone in same order" and not different undo stacks for each kinds or operations. 

About the marked node being unmarked: it feels like after marking a node, an undo 'step' was not created after this operation, and therefore, after  undoing some other subsequent operation, the 'mark node' also gets undone.

I might be wrong though - just a tought,.
--
Félix

Edward K. Ream

unread,
Oct 8, 2020, 11:40:41 AM10/8/20
to leo-editor
On Thu, Oct 8, 2020 at 6:58 AM gar <gar...@gmail.com> wrote:

Actually let my say a word about undo.
I feel very uncomfortable when undo unmarked nodes and remove clones. Actually when I started to use Leo I expected that there would be several undoes: for tree operations, for editors, for marks/clones etc.
Can anybody explain me why all the sorts of undoes are united?

I agree with the other respondents. The present operation is the simplest thing that could possibly work, both in concept and in implementation. This does not mean that the implementation is simple, it only means that no other simpler implementation has yet been found.

Kent Tenney has proposed, and Vitalije has implemented, a concept known as "node history". This allows one to look at the history of a node independently of questions of undo.

git also allows line-by-line perusal of the history of individual files, via git blame and gitk. In principle, one could track the history of nodes this way, but it would be quite clumsy. Still, git can recreate virtually any kind of history, with enough work.

I have no plans to change Leo's undo approach, which is described in the module level docstring in leoUndo.py.  See the section:
<< How Leo implements unlimited undo >>.

Finally, let me say that the problem with restoring marks will surely turn out to be a relatively simple bug to fix. The fix will happen shortly.

Edward

gar

unread,
Oct 8, 2020, 2:42:06 PM10/8/20
to leo-e...@googlegroups.com
a concept known as "node history".
where can I get familiar with it? I'd love to have node-scoped undo.
I use leo generally as a code editor, and I still deal with nodes as with files in any other code editor, but smaller size. 

Edward K. Ream

unread,
Oct 10, 2020, 9:48:25 AM10/10/20
to leo-editor
On Thu, Oct 8, 2020 at 1:42 PM gar <gar...@gmail.com> wrote:
a concept known as "node history".
where can I get familiar with it? I'd love to have node-scoped undo.

See the history_tracer.py plugin.

Edward
Reply all
Reply to author
Forward
0 new messages