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

Add soft failover to fast search #862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nyq
Copy link

@nyq nyq commented Aug 3, 2024

Summary

Modified filelist.cpp so that if standard fast search in file panel yields no results, a second search attempt is made by searching in the middle of filename strings.

Details

Expanded file panel fast search functionality to also search for matches in the middle of the filename strings if search in the beginning of the filename strings was unsuccessful. This is very helpful in two scenarios:

  1. When no exact match in the beginning of the filename string was found, but user would like to also find matches in the middle of the filenames.
  2. When directory contains files/folders that start with characters that can't be easily entered into fast search box like '[' and '{', yet the user would like to search beyond these characters.

Specific use case that justifies this change
A directory containing very large number sub-directories in the following format: {12345} where 12345 is a serial number. Such directlry can't be easily searched with fast search in current version of FAR because:

  1. Holding Alt key and pressing "{" key results in no response from FAR (pressing "{" key without Shift generates "[" character which is filtered out)
  2. Holding Alt key and pressing Shift-"{" to truly generate "{" character also results in no response from FAR
  3. So the only way to search in this situation is to hold Alt key, press any other character key to bring up the fast search window, then press Shift-"{" to enter "{" into the fast search window, and then type the rest of the characters, which is very tedious.

This pull request fixes this problem by allowing the user to directly enter characters that follow the "{" character. At the same time it does not break the standard fast search functionality because if there are strict matches in the beginning of the filename strings as per classic FAR behavior, they will be found first. New code will only resort to searching in the middle of the filename strings if the classic search was unsuccessful.

Expanded file panel fast search functionality to also search for matches in the middle of the string if search in the beginning of the string was unsuccessful. This is very helpful in two scenarios:
1) When no exact match in the beginning of the filename string was found, but user would like to also find matches in the middle of the filenames.
2) When directory contains files that start with characters that can't be easily entered into fast search box like '[' and '{', yet the user would like to search beyond these characters.
Copy link

sonarcloud bot commented Aug 3, 2024

@yegor-mialyk
Copy link
Contributor

I think this behavior has to be definitely configurable and not turned on "by default".

And why not macros?

Here is a good example I personally use (by @johnd0e):
https://forum.farmanager.com/viewtopic.php?f=15&t=9246

@alabuzhev
Copy link
Contributor

Specific use case that justifies this change
A directory containing very large number sub-directories in the following format: {12345} where 12345 is a serial number. Such directlry can't be easily searched with fast search in current version of FAR

But it can - press Alt+Shift+8, then enter your serial number.

@nyq
Copy link
Author

nyq commented Aug 5, 2024

Specific use case that justifies this change
A directory containing very large number sub-directories in the following format: {12345} where 12345 is a serial number. Such directlry can't be easily searched with fast search in current version of FAR

But it can - press Alt+Shift+8, then enter your serial number.

This is pretty burdensome when I have to do this several hundreds of times each day in the course of my work. Pressing Alt and typing a serial is much more ergonomic under heavy workload.

deep-soft added a commit to deep-soft/FarManager that referenced this pull request Sep 1, 2024
Expanded file panel fast search functionality to also search for matches in the middle of the string if search in the beginning of the string was unsuccessful. This is very helpful in two scenarios:
1) When no exact match in the beginning of the filename string was found, but user would like to also find matches in the middle of the filenames.
2) When directory contains files that start with characters that can't be easily entered into fast search box like '[' and '{', yet the user would like to search beyond these characters.
 soft_fast_search (FarGroup#862)
@nyq
nyq committed last month 
1 parent d61cbf7
commit d9a16fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants