OMG: Leo's find commands are about to become so much simpler

37 views
Skip to first unread message

Edward K. Ream

unread,
Nov 20, 2026, 9:46:29 AM (12 days ago) Nov 20
to leo-editor
​A few days ago, I thought I had found yet another bug in Leo's find commands.

I spent about an hour looking at the code and gave up in despair.

Later, while doing chores, I realized that I had likely misunderstood how Leo's find commands were (at the time) supposed to work. There were special cases involving how Leo treated backslashes.

Yesterday, I realized there were two (very different) ways of treating backslashes. They could be just ordinary characters, or they could represent the start of a "special character" like \n (newline) or \b (tab), \\ (an actual backslash.

I asked myself, how can we Leonistas switch between those two modes?

Almost as soon as I asked that question, I saw the answer:

- All characters should be ordinary in "plain" (non-regex) searches!
- All characters should act like regex characters in regex searches!

Doh! I'm embarrassed that it took so, so long to see the obvious! I suspect almost all text editors work the way I've just described.

Summary

Jake and I aren't likely the only ones who thought there was something wrong with Leo's find commands.

PR #5060 (under review) makes Leo work the way I've just described. It will be a huge step forward.

All of your questions and comments are welcome.

Edward

Edward K. Ream

unread,
Nov 20, 2026, 9:51:54 AM (12 days ago) Nov 20
to leo-e...@googlegroups.com
On Fri, Nov 20, 2026 at 8:46 AM Edward K. Ream <edre...@gmail.com> wrote:

> PR #5060 (under review) makes Leo work the way I've just described.

Oops. #5060 is the issue. The PR is #5062.

Edward

Edward K. Ream

unread,
Nov 20, 2026, 10:32:18 AM (12 days ago) Nov 20
to leo-e...@googlegroups.com
On Fri, Nov 20, 2026 at 8:46 AM Edward K. Ream <edre...@gmail.com> wrote:

> All characters should be ordinary in "plain" (non-regex) searches!
> All characters should act like regex characters in regex searches!

> Jake and I aren't likely the only ones who thought there was something wrong with Leo's find commands.
> PR #5060 (under review) makes Leo work the way I've just described.

The PR has now been merged into Leo's main branch.

Edward

jkn

unread,
Nov 20, 2026, 11:33:31 AM (12 days ago) Nov 20
to leo-editor
Very interesting ...

minor point of information - I am 'jkn' - ie my initials - not 'Jake'.
It's not at all a problem, just I have a minor cognitive jolt when
I see 'Jake' and realise that Edward might be talking about me ;-)

Thanks again for Leo

    Cheers
    jkn (aka 'J^n', aka 'Jon N')

Edward K. Ream

unread,
Nov 20, 2026, 11:36:47 AM (12 days ago) Nov 20
to leo-e...@googlegroups.com
On Fri, Nov 20, 2026 at 10:33 AM jkn <jkn...@nicorp.co.uk> wrote:
 
I am 'jkn' - ie my initials - not 'Jake'.

My apologies, Jon.

Edward

jkn

unread,
Nov 20, 2026, 11:43:41 AM (12 days ago) Nov 20
to leo-editor
No problem at all, Edward!

BTW, I have just added a post-merge review comment to https://github.com/leo-editor/leo-editor/pull/5062  ;-)

    J

Jacob Peck

unread,
Nov 20, 2026, 1:58:55 PM (12 days ago) Nov 20
to leo-e...@googlegroups.com, leo-editor
FWIW, I am a Jake, and I have complained about the Find commands before :) That was years ago though.  

Nice change, I appreciate it, even if I wasn’t the intended Jake.

On Nov 20, 2026, at 11:43 AM, jkn <jkn...@nicorp.co.uk> wrote:


--
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 visit https://groups.google.com/d/msgid/leo-editor/e376147c-6476-4975-b48c-e9c9e8549779n%40googlegroups.com.

jkn

unread,
Nov 20, 2026, 2:52:27 PM (12 days ago) Nov 20
to leo-editor
Hello Jake! Nice to see you here ;-)

    J^n
Reply all
Reply to author
Forward
0 new messages