-
Notifications
You must be signed in to change notification settings - Fork 70
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
bad argument #1 to 'for iterator' (table expected, got nil) #145
Comments
Can you please share your config and the commit hash of spacehammer: cd ~/.hammerspoon
git rev-parse @ |
Get that error too but doesn't seem to be preventing any functionality:
|
and commit hash is: |
Looks like a bug in modal's (fn active->submenu
[state action menu-key]
"
Enter a submenu like entering into the Window menu from the default main menu.
Takes the current menu state table and the submenu key as 'extra'.
Returns updated menu state
"
(let [{:config config
:menu prev-menu} state.context
menu (if menu-key
(find (by-key menu-key) prev-menu.items) ; prev-menu is probably :nil so .items is nil
config)]
{:state {:current-state :submenu
:context (merge state.context {:menu menu})}
:effect :open-submenu})) |
I think that this'll fix it. diff --git a/lib/modal.fnl b/lib/modal.fnl
index e97c2fc..625144d 100644
--- a/lib/modal.fnl
+++ b/lib/modal.fnl
@@ -317,7 +317,7 @@ switching menus in one place which is then powered by config.fnl.
Returns updated modal state machine state table.
"
{:state {:current-state :idle
- :context (merge state.context {:menu :nil
+ :context (merge state.context {:menu state.context.config
:history []})}
:effect :close-modal-menu})
@@ -488,7 +488,7 @@ switching menus in one place which is then powered by config.fnl.
"
(let [initial-context {:config config
:history []
- :menu :nil}
+ :menu config}
template {:state {:current-state :idle
:context initial-context}
:states states Could someone please test it? |
Just applied it, will follow up if I see issues in the log |
Did you happen to see anything? |
sorry for late feedback, the error still occurs.
|
just pulled the latest changes, will see whether the same error still occur. |
I have not merged this fix. You would have to manually apply the change I mention above to test the fix. |
applied the changes, will let you know whether it works. |
Any luck? |
this error seems caused by line 189 in apps.fnl the variable apps is nil, if i change apps to state.context.apps, the error will be gone. |
I pushed a PR to fix the second error, but note that it's not the same as your original error. |
@eccentric-j did my fix above fix the error you were having? Note that that error is not the same as the one fixed in #153, which is here: 2021-11-06 07:53:44: 07:53:44 ERROR: LuaSkin: hs.application.watcher callback: ./lib/apps.fnl:154: table index is nil
stack traceback:
./lib/apps.fnl:154: in local 'sub'
./lib/statemachine.fnl:44: in function 'lib.statemachine.send'
(...tail calls...) |
Just pulled, will let you know |
Haven't seen this since so I think it's fixed |
After start my computer, activate modal, got below error:
the main modal won't appear, then open hammerspoon console, main modal appears.
The text was updated successfully, but these errors were encountered: