Flow-Launcher / Flow.Launcher

:mag: Quick file search & app launcher for Windows with community-made plugins
https://flowlauncher.com
MIT License
7.17k stars 295 forks source link

Flow Launcher's Trimmed Query #2605

Open AminSallah opened 4 months ago

AminSallah commented 4 months ago

I noticed that Flow launcher consistently provides a trimmed query when using query.Search or even query.RawQuery, returning a value without white spaces. This seems unusual to me compared to other launcher apps. Therefore, my question is: is this intentional for some specific reason, or is it something that can be fixed?

jjw24 commented 4 months ago

query.Search should return query without any action keyword, and raw should return with action keyword if exists. This is intentional. Sorry not 100% clear on what you are asking, are you asking why they don't include a space at the end?

AminSallah commented 4 months ago

yeah they don't include white spaces

AminSallah commented 4 months ago

Is it possible to know if query contains spaces at the end?

jjw24 commented 4 months ago

Unfortunately no, we never came across a scenario where whitespaces were needed to be kept for a plugin. What's your use case?

AminSallah commented 4 months ago

I see it before in some alfred workspaces. it's used frequently if user types space show available commands if not use default one. In my case, with the Notion plugin I wanna implement a similar scenario. i split query by char ! then i wanna check if what after ! mark is whitespace show available properties names else use first index and start recording the page name. this gonna be more faster.

The current behavior after split by exclamation mark show property names after user select one show pages. I prefer to skip step one if no spaces, i hope if could explain my point.

spaces

jjw24 commented 4 months ago

Yeah that makes sense.

I thought both search and rawquery only trim the whitespaces at the start of the query string?

AminSallah commented 4 months ago

I thought this too, technically turns out it's trimming the end as well, i tried Search and RawQuery and SearchTerm also and they all return trimmed string. and i couldn't figure why it is trimmed.

Garulf commented 4 months ago

I thought I fixed this in a PR sometime ago. 🤔

Edit: https://github.com/Flow-Launcher/Flow.Launcher/pull/1121

AminSallah commented 4 months ago

Please double check it, I used this plugin to check whether is contain spaces or not. Release link

https://github.com/AminSallah/Flow.Launcher.Plugin.whitespaces/releases/download/v1.0.0/Flow.Launcher.Plugin.whitespaces.zip

Action keyword s

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 60 days.\n\nAlternatively this issue can be kept open by adding one of the following labels:\nkeep-fresh