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

Improve seal filesearch plugin #301

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jun 11, 2023

  1. Fix a race condition issue in Seal filesearch plugin

    Updated the Seal filesearch plugin to resolve a race
    condition which occurred when a new spotlight search
    was initiated before the completion of a previous search.
    This issue resulted in occasional receipt of obsolete
    `didFinish` spotlight events.
    
    To mitigate this, a unique `hs.spotlight` object is now
    assigned to each new search, and we disregard any event
    or callback that is not related to the current search.
    
    Additionally, the spotlight file search logic has been
    isolated into a distinct class for improved clarity.
    yannrouillard committed Jun 11, 2023
    Configuration menu
    Copy the full SHA
    9bc61a3 View commit details
    Browse the repository at this point in the history
  2. Improve responsiveness of Seal filesearch plugin

    Contrary to most plugins, the Seal filesearch plugin
    doesn't quickly filter results from an existing set
    in memory, but it triggers an actual spotlight search
    each time.
    
    That is more resource-intensive and calling it too
    frequently for each key typed does hurt the responsiveness
    of the Seal chooser (lua being single-threaded).
    
    To avoid that, the plugin now uses it own `queryChangedTimerDuration`
    parameter so it can be set to higher value compared to the
    defaut Seal one.
    The default of 100mn provides a good responsiveness
    while still display results with an acceptable delay.
    yannrouillard committed Jun 11, 2023
    Configuration menu
    Copy the full SHA
    cf679ff View commit details
    Browse the repository at this point in the history
  3. Improve search results order in Seal filesearch plugin

    Spotlight results naturally put first the items that
    were recently accessed.
    However it doesn't put first the item that really
    contain the word as it (not as a sub-part of the word)
    whereas it is often the ones you want first typically.
    
    We emulate that behaviour by re-ordering the results
    to boost the item that contains whole words.
    yannrouillard committed Jun 11, 2023
    Configuration menu
    Copy the full SHA
    8eba686 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c01feb2 View commit details
    Browse the repository at this point in the history