Skip to content
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

Search without Replace #1084

Open
rd836 opened this issue Aug 16, 2023 · 7 comments
Open

Search without Replace #1084

rd836 opened this issue Aug 16, 2023 · 7 comments
Assignees
Labels
feature-request New feature or request search

Comments

@rd836
Copy link

rd836 commented Aug 16, 2023

This is similar to my #561, and likely others. (E.g., #972.)

Some of us want to simply search, and not replace, or do anything else.

The Microsoft products, like Excel and Word, along with other programs like Notepad++, have the Replace function on a separate tab than Find, which helps to avoid unintentional replacements.

Can something similar be done with OneMore?
If they both have to be in one dialog box, can there at least be a checkbox to turn on or off the replacement function?

Some of us might be confused by trying to figure out if an empty Replace field means "do nothing" or replace with nothing, which is actually deleting.

@hollowheights
Copy link

Did this get implemented? I was wondering exactly the same thing today

@stevencohn
Copy link
Owner

No it has not yet

@cspotcode
Copy link

...might be confused...

I almost got caught by this, but thankfully was wise enough to try it on a test page first.

I have used OneMore's "Search and Move or Copy" as an alternative UI to search for pages matching a query. Could regexp be added to that dialog? Maybe not, since it appears to use OneNote's Windows Search. But it already has a nice UI for listing matched pages and letting you click each to navigate.

My dream wishlist, I would love to be able to:

  • Ctrl+F or Ctrl+Shift+F to open the search UI
  • Press Enter repeatedly to jump to the next search result within a page.
    • OneNote's interop API does not expose the ability to highlight search matches in yellow the way built-in search does.
    • Does it allow manipulating the caret selection? Would this require unreasonably complex XML manipulation?
  • Alternative to the above: show a list of matched text fragments in the search dialog?

@stevencohn
Copy link
Owner

That's been my dream as well. Would require replacing Windows Search with some other engine... Lucene, CoreSearch, .Lifti, ... ?

@cspotcode
Copy link

I had a crazy thought: what if someone hooked the OneNote process to intercept all its COM calls to Windows Search API and replace with their own implementation. But that's so far beyond my abilities, probably requires Detours(?) and is such a huge jump in complexity. Would have to be its own project.

@stevencohn
Copy link
Owner

stevencohn commented Nov 11, 2024

I didn't state that correctly. I didn't mean replace the Windows Search engine. I meant that OneMore would have its own search engine and would ignore Windows Search. The built-in Ctrl-F and Ctrl-E would still hook into Windows Search; and Windows Search would still index OneNote content (unless you remove OneMore from the Windows Search Control Panel)

And yes, I'm afraid your idea might be crazy. :-) It could very likely break Windows while OneNote is running!

@cspotcode
Copy link

cspotcode commented Nov 11, 2024

Oh, sorry, you were clear, I understood what you meant.

My (crazy) reason for hooking OneNote process was to reuse the existing search UI, keep its tight UI integration. But thinking about it again, that's not desirable: OneNote's built-in search UI is fundamentally limited.

You raised a good point about Ctrl-F and Ctrl-E:
Ctrl-E uses Windows Search, but Ctrl+F does not. I say this because Ctrl+E search will sometimes return zero results yet will yellow-highlight matches in the current page. So they seem like two separate mechanisms.

So if Ctrl+F is already doing its own thing, then we can't get the yellow highlights on a regexp search.


It could very likely break Windows

Yeah maybe. I had imagined hooking the OneNote process so it doesn't actually call Windows Search, passes the request to different API. But not hook Windows Search itself. But I'm out of my depth w/hooking.


Anyway... full replacement search would be cool. I'll keep tinkering on #1659 (comment), share if I build anything useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request search
Projects
None yet
Development

No branches or pull requests

4 participants