The conundrum
Control-clicking on a name searched for the definition of the name. To do this, the original code modified our search settings. I imagined this behavior to be essential because we want to be able to continue searching using F2 and F3. But there is no easy way to restore the search settings! This disruption of our preferences is an annoying hangnail.
The Ahas
Aha 1: Use bespoke search code that doesn't use Leo's search settings. This code will be straightforward. Unlike general searches, finding definitions will search only body text.
Aha 2: Allow the searches to return multiple results. There is no need for follow-on searches!
Leo will work as before if there is only one result. If there are multiple results, control-clicking can show those results either:
- As cloned nodes, as in the clone-find command.
- As a single summary node (with clickable links) as in the find-all command.
A new user setting will specify the default. A new toggle command will toggle the current value of the setting.
Aha 3: Let the top-level results node (of either type) tell the user about the new setting and the command to change it.
Summary
These Ahas constitute a new design pattern for searches. Control-clicks on a symbol will show the user all the search results.
#3871 will be part of Leo 6.8.0 beta 1.
Edward
I don't like returning the results as cloned nodes. That changes the outline, and a search should not do that. The search will change the focus to the new cloned results, which is distracting and unexpected. And later the user has to remember to find and delete those clones without accidentally deleting something that should remain.The format used by the Nav tab is ideal (and highly readable, better than cloning nodes) and that's what I would greatly prefer. No need for a new setting and setting-toggle command, no need to step from one instance to the next or back, no need to insert any new nodes.