scottwhudson / Lunette

Zero-Config Spectacle Keybindings for Hammerspoon
MIT License
81 stars 19 forks source link

Packaging of Lunette v0.3.1 doesn't include commits for v0.3.1? #13

Open menicosia opened 4 years ago

menicosia commented 4 years ago

Hey there, I have been wondering why Lunette's last distribution hasn't been loading for me, and I just got some time to investigate. I think maybe something went wrong when packaging this release and attaching to the Github release?

Here's my evidence:

→ (cd Lunette/ ; git status)
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
→ tar xzf ../Lunette-0.3.1.tar.gz
→ cd Lunette-0.3.1/Spoons/
→ unzip Lunette.spoon.zip
Archive:  Lunette.spoon.zip
   creating: Lunette.spoon/
  inflating: Lunette.spoon/validator.lua
  inflating: Lunette.spoon/init.lua
  inflating: Lunette.spoon/history.lua
  inflating: Lunette.spoon/command.lua
  inflating: Lunette.spoon/resize.lua
→ cd ../..
→ diff Lunette/Source/Lunette.spoon/command.lua Lunette-0.3.1/Spoons/Lunette.spoon/command.lua
5c5
< --- Load dependencies
---
> -- Load dependencies
15,21c15,21
< --- Command:leftHalf(windowFrame, screenFrame)
< --- Method
< --- Inspects current screen frame position, determines how to resize given frame
< --- and calls corresponding resize method
< ---
< --- Returns:
< --- * A screenFrame to be rendered
---
> -- Command:leftHalf(windowFrame, screenFrame)
> -- Method
> -- Inspects current screen frame position, determines how to resize given frame
> -- and calls corresponding resize method
> --
> -- Returns:
> -- * A screenFrame to be rendered
...

→ diff Lunette/Source/Lunette.spoon/command.lua Lunette-0.3.1/Source/Lunette.spoon/command.lua | head -20
5c5
< --- Load dependencies
---
> -- Load dependencies
15,21c15,21
< --- Command:leftHalf(windowFrame, screenFrame)
< --- Method
< --- Inspects current screen frame position, determines how to resize given frame
< --- and calls corresponding resize method
< ---
< --- Returns:
< --- * A screenFrame to be rendered
---
> -- Command:leftHalf(windowFrame, screenFrame)
> -- Method
> -- Inspects current screen frame position, determines how to resize given frame
> -- and calls corresponding resize method
> --
> -- Returns:
> -- * A screenFrame to be rendered

For me, copying from master to my .hammerspoon directory solves the problems created when trying to install from Lunette-0.3.1.tar.gz.

Am I missing something, or is this an actual bug?

menicosia commented 4 years ago

Huh. It's only partially working. When trying to use the key bindings while focused on the Hammerspoon console:

2020-01-31 16:22:31: Lunette: rightHalf
2020-01-31 16:22:31: function: 0x60000297b0f0
2020-01-31 16:22:31: Lunette: rightHalf
2020-01-31 16:22:31: function: 0x60000297b0f0

But when focused on an iTerm2 (or nearly any other app) window:

2020-01-31 16:22:39: 16:22:39 ERROR:   LuaSkin: hs.hotkey callback: /Users/pivotal/.hammerspoon/Spoons/Lunette.spoon/init.lua:108: attempt to index a nil value (local 'window')
stack traceback:
    /Users/pivotal/.hammerspoon/Spoons/Lunette.spoon/init.lua:108: in function 'Lunette.exec'
    /Users/pivotal/.hammerspoon/Spoons/Lunette.spoon/init.lua:99: in function </Users/pivotal/.hammerspoon/Spoons/Lunette.spoon/init.lua:98>
menicosia commented 4 years ago

Restarting Hammerspoon(!) seemed to fix that issue while running v0.3.1 files (ie comments start with two dashes, not three). My best guess is that Hammerspoon somehow lost OSX Accessibility, but didn't know that.

I'm still quite a bit confused why v0.3.1 files don't seem to match master - was maybe PR #10 was never merged back to master?