Retain search query on focus (0.8.0)

There are times when I want to toggle focus from notes to search using the keyboard, and I don’t want to lose the search query. Currently, the search command always clears the query. I’m not sure whether the search query should always be retained, or there should be a separate command to “focus on search”. Alternately a command to focus on the sidebar would also work.

3 Likes

Or maybe a history of search commands? Place cursor in search and your history drops down. Maybe that would be too annoying, but it could be a toggle on/toggle off.

Maybe it could be solved with Allow Multiple search panes at the same time
For example Main search pane in sidebar would be target of hotkey “Search in all files” which replaces search string by selected text as it does now. While other search panes not targeted by this hotkey would as a side-effect retain it’s search string. They can be activated conveniently by Hotkey to "Focus on last active pane".

Also concept of “cursor”/“current line” should be introduced into lists of search results and backlinks, that would keep last selected result highlighted while switching between panes. Similarly to edit mode: Improving visibility of caret(cursor) position in editor mode

1 Like

Also concept of “cursor”/“current line” should be introduced into lists of search results and backlinks

Yes. Search navigation is IMO broken.

I typically want to go through multiple results to review and make changes.

Problems:

  • Keyboard navigation in the search results doesn’t automatically open the result, so I have to click on each one.

  • There’s no “cursor” in the search results, so once I click on one result, it doesn’t stay selected/highlighted.
    When I want to navigate to next search result I can’t see the “current” one so I have to find the “current” result in the list so I click through results until I find before I could go to the next one. This completely breaks the flow and I spend more time searching the search results rather than navigating them.