Quorafind / Obsidian-Float-Search

A plugin for searching text by using Obsidian default search view.
GNU General Public License v3.0
149 stars 5 forks source link

[Bug]: "Search in current file" doesn't work when having spaces #25

Closed antomonte closed 1 year ago

antomonte commented 1 year ago

Bug Description

This feature adds directly the whole path + filename after "path:" command, but when the file path contains any space, the whole command will not work.

However, when adding quotes to the path+filename... it will work.

Relevant Screenshot

No response

To Reproduce

  1. Create any folder structure where some of the folders contain at least one space

  2. within such a folder, put or create a note with some content

    • for instance : 000. My folder/Test Folder/MyTestNote.md
  3. launch "Floating Search: Search in current file" and just write some content you know it actually exists

    • it will be like this : path:000. My folder/Test Folder/MyTestNote.md word_to_search
  4. you'll realize that it doesn't return any results

  5. put the whole path&filename between quotes

    • like this: path:"000. My folder/Test Folder/MyTestNote.md" word_to_search

6.- now... it will work fine

So, it seems that the solution is simply to add quotes to the path/file info.

Obsidian Version

1.3.5

Checklist