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 within document #73

Closed
maxkueng opened this issue Jan 18, 2016 · 5 comments
Closed

Search within document #73

maxkueng opened this issue Jan 18, 2016 · 5 comments

Comments

@maxkueng
Copy link
Collaborator

Would be nice to be able to search within a document.

I was thinking about the following functionality, similar to how it works in browsers:

  • Press Control/Cmd+F or select "Search" from a menu, type search query.
  • Highlight all results (preferably as you type).
  • Jump back and forth between results.
  • Press Esc to hide search input and clear results.

Things to check out:

  • webContents.findInPage(text[, options]) (docs)
  • webContents.stopFindInPage(action) (docs)
@xaviervalarino
Copy link

As mentioned in #91, it would be nice to be able to trigger a text search by using the / key (the same key used for search in Vi/Vim)

@markbrown4
Copy link

I'm happy to make a start on this feature.

@maxkueng
Copy link
Collaborator Author

@markbrown4: That would be awesome!

@maxkueng
Copy link
Collaborator Author

Someone had already made a pretty awesome module (thanks @rhysd!) and adding it was straight-forward.

For now it uses the module's default styles and looks a little "rough" but it's usable and really helps a lot already.

Hit Ctrl+F or Cmd+F to open the search dialog.

vmd 1.31.0 is on npm and packaged builds will be ready in a few minutes.

@josephfrazier
Copy link
Contributor

  • Press Esc to hide search input and clear results.

Do you know how difficult it would be to implement this? I love the new search feature, but I instinctively press Escape to stop searching, only to have the entire window close. It looks like electron-in-page-search has some relevant code, so hopefully it's not too hard to wire up: https://github.com/rhysd/electron-in-page-search/blob/7e26dba74bc687a715a7be0634413278c6ea4460/src/search-window.ts#L50-L52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants