Undo Removed A Sequence Of Changes Instead Of Just The Last One

40 views
Skip to first unread message

Thomas Passin

unread,
Oct 14, 2020, 4:19:41 PM10/14/20
to leo-e...@googlegroups.com
I needed to add some spaces between parts of a string.  I added several, then wanted to undo just the last one.  Instead, all of the added spaces were removed with a single <CTRL-z> command.  Note that this string was all on a single line.

This behavior repeated several times. 

Leo 6.3-devel, devel branch, build b6c70a7c7e
2020-10-13 16:26:16 -0400
Python 3.8.5, PyQt version 5.15.1

Edward K. Ream

unread,
Oct 15, 2020, 5:16:52 AM10/15/20
to leo-editor
On Wed, Oct 14, 2020 at 3:19 PM Thomas Passin <tbp1...@gmail.com> wrote:

I needed to add some spaces between parts of a string.  I added several, then wanted to undo just the last one.  Instead, all of the added spaces were removed with a single <CTRL-z> command.

This is the expected default action.  The "undo granularity" is "line" by default.  See:

@string undo-granularity

Thomas, I appreciate your attention to detail. It's an important trait for devs :-)

Edward

Thomas Passin

unread,
Oct 15, 2020, 9:22:47 AM10/15/20
to leo-editor
Thanks, Edward.  BTW, I can't find any reference to it in the docs I looked at. I had to search LeoPyRef.leo to find it and the values it recognizes. Of course, I would have had no idea even to look for it if you hadn't clued me in.

Edward K. Ream

unread,
Oct 15, 2020, 10:05:36 AM10/15/20
to leo-editor
On Thu, Oct 15, 2020 at 8:22 AM Thomas Passin <tbp1...@gmail.com> wrote:
Thanks, Edward.  BTW, I can't find any reference to it in the docs I looked at. I had to search LeoPyRef.leo to find it and the values it recognizes. Of course, I would have had no idea even to look for it if you hadn't clued me in.

This is a perennial problem.

I have this theory that the best way to organize and find data is by using outlines. Yeah, it's kinda silly of me. I also have this theory that words words words are hard to digest and understand.

Imo, those theories imply that the best way to understand Leo's options is to search leoSettings.leo. Using "headline-only" searches helps. When you search for "undo", you will find:

    leoSettings.leo#@settings-->Command options-->Undo settings

That node has only three children, so it shouldn't be that hard to discover that @string undo-granularity might have something to do with your issue.

Yes, all this is likely clear in retrospect, but still, searching leoSettings.leo is typically a good idea. And a better idea than searching LeoDocs.leo.

Edward

Thomas Passin

unread,
Oct 15, 2020, 11:38:53 AM10/15/20
to leo-editor
Ha! I searched LeoPyRef.leo and didn't think about leoSettings.leo.  One of those weird things!  And yes, I found nothing about it in LeoDocs.

I wonder how we could make it clear to newcomers that this kind of search can be useful.
Reply all
Reply to author
Forward
0 new messages