FarGroup / FarManager

File and Archive Manager
https://farmanager.com
BSD 3-Clause "New" or "Revised" License
1.81k stars 202 forks source link

Lock filter command for menus does not work #580

Open rohitab opened 1 year ago

rohitab commented 1 year ago

Far Manager version

3.0.6074.0 x64

OS version

10.0.22623.1037

Other software

No response

Steps to reproduce

  1. Press F9 to show the menu bar
  2. Press L to open the Left dropdown menu
  3. Press the right Alt to enable filtering mode
  4. Type in file. The menu will now only show items with file in their name, viz. File owners and File links.
  5. Press Ctrl+Alt+L to lock the filter. The filter indicator will change from [file] to <file> indicating that the filter is locked.
  6. Press F10 or Esc to close the dropdown menu
  7. Press L to open the Left dropdown menu again

Expected behavior

The menu should show filtered items only since the filter was locked. The filter indicator should show <file>.

Actual behavior

The menu shows all items. The filter indicator is not displayed.

Note that the Lock filter command does not work in any of these menus either:

In all the above cases, the filter indicator changes to show that the filter is locked. However, closing and reopening the menu removes the filter.

alabuzhev commented 1 year ago

The menu should show filtered items only since the filter was locked.

"Lock the filter" does not mean "make it permanent", but "stop accepting more letters into the filter and let the menu process the pressed keys as usual".

Menus can have user-configured or autogenerated hotkeys to invoke corresponding items. The filter intercepts the input and hotkeys don't work, locking it allows to use the hotkeys again.

rohitab commented 1 year ago

I see. Please feel free to remove the bug tag.

It would be a nice feature to have. Would you consider adding it as an enhancement?

alabuzhev commented 1 year ago

Persisting and restoring filter state sounds interesting. However, unlike, say, panels, menus are not that unique, there is a legion of them all over the place. Coming up with an universal solution (that would also cover menus spawned by plugins and macros) could be tricky, so no ETA for this.

rohitab commented 1 year ago

No worries. I'll be happy to test it out whenever it's ready. Thanks.