Flow-Launcher / Flow.Launcher

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

Custom Query Hotkey feature not usable because of incorrect caret position #1070

Closed stax76 closed 2 years ago

stax76 commented 2 years ago

Describe the bug/issue

Maybe I'm the only user wanting to use this feature. The Custom Query Hotkey feature is not usable because the caret position is at the beginning of the query at index 0. At the end of the query should be a space and after that space is the supposed caret position.

To Reproduce

  1. Assign 'b' as 'Action Keyword' for the 'Browser Bookmarks' plugin.
  2. Create a Custom Query Hotkey with 'b ' as query.
  3. Press the hotkey, caret is at pos 0 instead of pos 2.

Screenshots

Screenshot (18)

Screenshot (19)

Your System

(It's Windows 11)
Microsoft Windows [Version 10.0.22000.493]
Flow Launcher version: 1.9.3
taooceros commented 2 years ago

I also use that feature a lot but hasn't able to reproduce the same issue. Could you share the log as well?

Some has shared the same issue, but the reason is still unclear.

stax76 commented 2 years ago

Log file:

2022-03-08.txt

stax76 commented 2 years ago

My screen is 4K at 288 DPI, enabled plugins:

Browser Bookmarks (b) Favorites (*) Plugin Manager (pm) Program (p)

I would guess a threading issue, if it's not reproducible I could have a look.

medlir commented 2 years ago

Possibly related to issue #1025 as well where the cursor isn't ending up in the right place for Win+R either.

stax76 commented 2 years ago

I can reproduce it consistently and can try to debug it tomorrow.

taooceros commented 2 years ago

I can reproduce it consistently and can try to debug it tomorrow.

That will be awesome! Thank you

Possibly related to issue #1025 as well where the cursor isn't ending up in the right place for Win+R either.

I think they are the same issue. (Both are using ChangeQuery method).

medlir commented 2 years ago

I've been playing with running debug builds for a bit tonight, and while I haven't tracked it down in code, I believe I've found the trigger, which appears to be be setting "Last Query Style" to "Empty last Query" rather than the default of "Select last Query". Wiping out my entire AppData/Roaming/FlowLauncher dir so I have completely clean settings, both custom hotkey and Win+R work as expected on clean startup after skipping the intro help dialog. If you toggle ONLY that setting to "EMpty last Query" AND close and relaunch, on relaunch the cursor will be at the beginning of the line for both custom hotkey and Win+R.

taooceros commented 2 years ago

ok make sense. I will check that part of code tmr (or probably at the weekend)?

stax76 commented 2 years ago

Duplicate of #1025

Garulf commented 2 years ago

I've been playing with running debug builds for a bit tonight, and while I haven't tracked it down in code, I believe I've found the trigger, which appears to be be setting "Last Query Style" to "Empty last Query" rather than the default of "Select last Query". Wiping out my entire AppData/Roaming/FlowLauncher dir so I have completely clean settings, both custom hotkey and Win+R work as expected on clean startup after skipping the intro help dialog. If you toggle ONLY that setting to "EMpty last Query" AND close and relaunch, on relaunch the cursor will be at the beginning of the line for both custom hotkey and Win+R.

Oh wow! I could see how that could cause an issue! Thanks for looking into this.

taooceros commented 2 years ago

I've been playing with running debug builds for a bit tonight, and while I haven't tracked it down in code, I believe I've found the trigger, which appears to be be setting "Last Query Style" to "Empty last Query" rather than the default of "Select last Query". Wiping out my entire AppData/Roaming/FlowLauncher dir so I have completely clean settings, both custom hotkey and Win+R work as expected on clean startup after skipping the intro help dialog. If you toggle ONLY that setting to "EMpty last Query" AND close and relaunch, on relaunch the cursor will be at the beginning of the line for both custom hotkey and Win+R.

I don't know why but even if I use empty last query and close and relaunch, I won't have these issue.

BTW if you have setup the environment, check these lines.

https://github.com/Flow-Launcher/Flow.Launcher/blob/749e7ff618be372487cb3e837b5c01cbc5817247/Flow.Launcher/MainWindow.xaml.cs#L157-L163

https://github.com/Flow-Launcher/Flow.Launcher/blob/749e7ff618be372487cb3e837b5c01cbc5817247/Flow.Launcher/ViewModel/MainViewModel.cs#L343-L355

stax76 commented 2 years ago

I made a PR into the dev branch, is that correct, or rather master branch?

taooceros commented 2 years ago

I made a PR into the dev branch, is that correct, or rather master branch?

That's correct. Thank you!

taooceros commented 2 years ago

Try this build https://ci.appveyor.com/api/buildjobs/x8hiob8qxh39jy7k/artifacts/Output%2FPackages%2FFlow-Launcher-Setup.exe

stax76 commented 2 years ago

I tested the build 5 minutes, it's fine.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.