Skip to content

Fix health check with lazy.nvim, handle null playlists, preserve C-p for navigation - #3

Open
rosscondie wants to merge 3 commits into
bautistaaa:mainfrom
rosscondie:main
Open

rosscondie wants to merge 3 commits into
bautistaaa:mainfrom
rosscondie:main

Conversation

@rosscondie

Copy link
Copy Markdown

Hey Trash sick plugin, thanks for building it I heard about it on the podcast btw.

It wasn't working out of the box with LazyVim for me, so I dug in a bit and noticed a couple of small issues. Also added C-p for navigation again as it collided with Telescope's default for previous, happy to drop that part if it's too much but the null check and health check fixes would be useful I think.

1. Fix health check discovery when plugin is lazy-loaded

README lazy.nvim example used cmd = { "Jam" } and lazy=true even with LazyVim.defaults.lazy=false. lua/jam/health.lua stays off &rtp until :Jam loads, so :checkhealth jam shows No healthcheck found for every LazyVim user following the docs (while :Jam health works). Removed cmd from docs so :checkhealth jam is discoverable eagerly.

2. Handle null playlist items returned by Spotify search

GET /search?q=Beatles&type=playlist returns [null,null,{...}] for restricted playlists -> vim.NIL (truthy) -> providers/spotify.lua:51 normalize crashes attempt to index userdata. Guarded normalize and all buckets (search, album_tracks, artist_top_tracks, show_episodes, playlist_items, now_playing) to skip vim.NIL. Unfiltered Beatles now OK 56 vs crash before.

3. Preserve C-p for navigation and remap pause to M-p

ui/picker.lua mapped <C-p> -> pause, shadowing telescope/mappings.lua:145 C-p = move_selection_previous. Normal vim users expect C-p/C-n to move. Remapped pause to <M-p> (Alt-p) in both pickers and updated README.md/doc/jam.txt. Requires Option as Alt in Kitty/WezTerm/iTerm on macOS.

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

Successfully merging this pull request may close these issues.

1 participant