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

[BUG] Sometimes previously typed search phrase is not selected on opening Omnisearch again #105

Closed
beetrootpaul opened this issue Oct 3, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@beetrootpaul
Copy link

beetrootpaul commented Oct 3, 2022

Am not sure whether to consider it a bug or a feature request, but since it seems Omnisearch behaves in an inconsistent manner on an edge case, I think it's more like a bug:

Problem description:

Usually when I open Omnisearch, the previously typed search phrase is there, already selected, so whatever I type will replace the old one. But sometimes the cursors is at the end of the previous phrase, making me unconsciously type after it, resulting with a search phrase being a concatenation of the old and the new one.

I managed to reproduce it in a quite deterministic manner, but there are still situations where I am not sure about its determinism.

What I try to do to reproduce the issues:

  1. Have some note open to edit, copt some text from it.
  2. Open Omnisearch with an assigned Cmd+O shortcut, type some phrase, select some results and Enter it
  3. In the open note place cursor somewhere in a text and press Right then Cmd+V to paste clipboard content (I know it sounds riddiculous, but I try to explain how do I reproduce the case 😅 )
  4. Open Omnisearch, expect the previous search phrase to be there, selected whole
  5. Esc back to the note
  6. Once again press Right, then Cmd+V to paste
  7. Open Omnisearch, now there is no selection and cursor is at the phrase's end (and I think I saw selection to blink for a slight moment) before disappearing, while I would expect the whole phrase to be selected, as usual

BTW I stuck upon this issue a lot when I switch between windows, but was unable to reproduce it in a kinda deterministic way, while the steps with copy-paste worked for me.

Just in case, this is my setup regarding editing modes, but please be aware I was able to reproduce the issue in both "Source mode" (the one I use) and the "Live Preview" mode

screenshot 2022-10-03 at 13 20 32

Your environment:

  • Omnisearch version: 1.6.4
  • Obsidian version: 0.15.9
  • Operating system: macOS Monterey 12.6
  • Number of notes in your vault (approx.): app.vault.getFiles() yields 13632 for me
  • Other plugins that may be related to the issue: none, since I disabled all of them and set default theme as well
@beetrootpaul beetrootpaul changed the title [BUG] Sometimes previously typed search phrase is not selected on opening Omnisearch again (case with copy-pasting_ [BUG] Sometimes previously typed search phrase is not selected on opening Omnisearch again (case with copy-pasting) Oct 3, 2022
@scambier scambier added the bug Something isn't working label Oct 3, 2022
@S-Wil
Copy link

S-Wil commented Oct 18, 2022

I'm having the same problem - would appreciate a fix. Thanks.

@menagerie198
Copy link

Me too - could we have a setting to clear previous searches upon close/open of Omni?

@beetrootpaul beetrootpaul changed the title [BUG] Sometimes previously typed search phrase is not selected on opening Omnisearch again (case with copy-pasting) [BUG] Sometimes previously typed search phrase is not selected on opening Omnisearch again Oct 19, 2022
@beetrootpaul
Copy link
Author

One more idea: if fixing phrase not always selecting on Omnisearch open happen to be difficult, maybe a simpler temporary workaround would be to have settings option to always open Omnisearch with an empty input 🤔

@scambier
Copy link
Owner

I'll take a look at this issue asap, probably once PDF indexing is shipped.

@steveawawa
Copy link

I have noticed that if I use the keyboard to navigate to a search result, then the search term is saved as expected.

However, if I use the mouse to go to the note, the search term is not saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants