-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR for #3871: searching for definitions should not change search settings #3872
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@boltex This PR will probably affect both LeoInteg and LeoJS. |
@edreamleo When reading about this, I also thought about suggesting re-using the nav pane! If you make results use the same objects-structure as nav pane clickable results, I wont even have to modify LeoInteg! :) (it mirrors those nav pane results in it's 'goto' pane) I'll review and try it out as soon as I finish debugging and polishing 'detached body panes' in leoJS and LeoInteg, in a day or two. |
@boltex Recent revs put the results in the Will that plan be good enough for you? |
I just checked out this branch to try before reviewing. When Leo started I got this error message (Leo seems to be working all right):
Some time later, I noticed this one: On the devel branch last night, the @ifplatform worked as expected - I got a different submenu on Linux than on Windows.
|
@tbpassin Thanks for your testing. The crashes you report have nothing to do with this issue. You may file a separate issue if you like. |
: ) I knew that but mentioned it in case you recognized having made a change recently. I'm just now exercising the branch before reviewing the code. |
@tbpassin I haven't touched any menu code in awhile. My guess: your issue might be a lapse in detecting user errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leoFind.py
Lines 572 ff # Look for alternate matches only if there are no exact matches.
I wonder if this is worth the extra time it takes when there is no match. Of course, no-match shouldn't occur very often, so maybe it's a moot point.
Lines 627 ff -
# The Nav pane can show only one match, so issue a warning.
if len(unique_matches) > 1:
g.es_print(f"Multiple matches for {word}", color='red')
for z in unique_matches[1:]:
g.es_print(z)
# Put the first match in the Nav pane's edit widget and update.
x.clear()
e.setText(unique_matches[0])
c.frame.log.selectTab('Nav')
I suppose this is to handle the case when more than one kind of hit happens (e.g., def vs Class), is that right? I can understand why the code is in here, but it's going to be weird to have the log pane flash the message and then the view will switch right back to the Nav pane. I don't have a solution to offer right now but I think we should keep trying to find one.
Otherwise I didn't notice anything to comment on. Very nice work! I'm elated to see the results in the Nav pane. The very first thing I tried is to CTRL-click on c.free_layout.get_top_splitter()
. The two places I knew about from earlier showed up in the Nav pane as desired.
@tbpassin Thanks for your approval. Not searching for alternates makes a noticeable difference. |
See #3871.
Breaking change to Leo's API: This PR changes the signatures of
find.find_def
andfind.find_var
.find-def
andfind-var
commands. These commands are now synonymous.@nosearch
.do_find_def
must honor@bool reverse-find-defs
.@bool prefer-nav-pane
, with default set toTrue
to match most Leonistas' preferences.Nav
pane if thequicksearch
plugin is enabled.clone-find
commands.Note: regardless of this setting, Leo selects unique search results by selecting the node.
Minor changes
c.quicksearch_controller = None
.QuickSearchController.__init__
setsc.quicksearch_controller = self
.