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