Skip to content

"Find in page" cannot find content if it is folded or not loaded (at the bottom of a long page) #9522

@lefth

Description

@lefth

Search first

  • I searched and no similar issues were found

What Happened?

I pressed ctrl+f to find content on the current page. The search term was not found despite being part of the page (folded/collapsed, not currently visible).

Reproduce the Bug

Create this page:

- # Ingredients
  collapsed:: true
	- A ghost pepper
- # Directions
  collapsed:: true
	- Eat the pepper

Press ctrl+f and search for pepper. There are no matches.

Expected Behavior

The full document should be searched, not the rendered content. When going to the next match, folds should be expanded.

Screenshots

No response

Desktop or Mobile Platform Information

Windows 11, Desktop App v0.9.8.

Additional Context

A quick reference for this behavior is Visual Studio Code, Visual Studio, or even vim. (To test in vim, type some text, select all with ggVG, fold with :fold<enter>, and search for anything with /.<enter>.)

This fix will require extra work: currently the search finds results in both the main panel and the sidebar. However it should search whichever panel has focus.

(Point for discussion: if the side panel is selected, all documents that are present in the side panel should be searched.)

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions