Hammerspoon / Spoons

The official repository of Spoon plugins
https://www.hammerspoon.org/Spoons/
453 stars 141 forks source link

Unintuitive Seal Query Matches #232

Closed cmpadden closed 3 years ago

cmpadden commented 3 years ago

While using the Seal Spoon, I have experienced unintuitive behavior while searching for commands. I would expect that searching for the word Capture would return all command results for the screencapture plugin, however, no results are displayed.

The search term sc, returns matches:

image

But the search term Scr does not:

image

Please let me know if I am not using this Spoon as intended -- my configuration of the Seal spoon can be seen below.

spoon.SpoonInstall:andUse("Seal",
  {
    hotkeys = { show = { {"cmd"}, "space" } },
    fn = function(s)
      s:loadPlugins({
        "screencapture"
      })
      s:refreshAllCommands()
    end,
    start = true,
  }
)

Edit This may just be user error in using the Seal plugin. My initial impression was that I would be able to search for any string within a command, but I now realize that I have to prefix my search with the plugin's cmd value (sc for screencapture).

https://github.com/Hammerspoon/Spoons/blob/master/Source/Seal.spoon/seal_screencapture.lua#L48

gineer01 commented 3 years ago

"Sc" in the first screenshot matches the command sc in the seal plugin screen capture, so Seal shows the choices in https://github.com/Hammerspoon/Spoons/blob/master/Source/Seal.spoon/seal_screencapture.lua#L13 . In the second screenshot, "Scr" no longer matches the command, so it doesn't show anything.

The filtering behavior depends on the specific plugin. In the sc case, you can see how it does filtering at this line: https://github.com/Hammerspoon/Spoons/blob/master/Source/Seal.spoon/seal_screencapture.lua#L65 . The query is the string after command: sc <query>

cmpadden commented 3 years ago

Thanks for the clarification, @gineer01. I think this "issue" boils down to user error, and me not fully understanding how Seal works. I appreciate it!