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

KSheet has no bind_hotkeys and no toggle #14

Open
winmillwill opened this issue Apr 24, 2018 · 4 comments
Open

KSheet has no bind_hotkeys and no toggle #14

winmillwill opened this issue Apr 24, 2018 · 4 comments

Comments

@winmillwill
Copy link

I get an error with the KSheet config because that spoon has no bind_hotkeys method and no toggle method. I looked through the git history and it doesn't seem to ever have had those methods. Is the fix to just rewrite the plugin in my spoons repo, or is there something automatic that should be inferring how to toggle and bind?

@zzamboni
Copy link
Owner

This is really strange. The copy of the spoon that I have (installed some time ago) does have those functions. You can see the full file here: https://gist.github.com/zzamboni/937fbce4c2d1894690604298b2e48a41

Comparing with the file that now comes with the spoon, the only difference is exactly these lines at the end of the module:

function obj:toggle()
  if self.sheetView and self.sheetView:hswindow() and self.sheetView:hswindow():isVisible() then
    self:hide()
  else
    self:show()
  end
end

function obj:bindHotkeys(mapping)
  local actions = {
    toggle = hs.fnutils.partial(self.toggle, self),
    show = hs.fnutils.partial(self.show, self),
    hide = hs.fnutils.partial(self.hide, self)
  }
  hs.spoons.bindHotkeysToSpec(actions, mapping)
end

I have no idea what happened - I installed KSheet some time ago and used it as documented. I also looked at the gist history and don't see those changes taking place. Maybe @ashfinal or @cmsj can clarify? In any case it would be great to restore the full file to the official spoon file.

@plygrnd
Copy link

plygrnd commented Apr 11, 2019

This is still an issue; attempting to install KSheet results in errors, because bindHotKeys is missing.

@plygrnd
Copy link

plygrnd commented Apr 11, 2019

Sent a PR.

@zzamboni
Copy link
Owner

Thanks! Maybe I made those changes locally and forgot to file a PR myself.

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

No branches or pull requests

3 participants