jiriks74 / presence.nvim

Discord Rich Presence for Neovim
GNU General Public License v3.0
23 stars 6 forks source link

make nvim socket path discovery more permissive #34

Closed andreykaipov closed 7 months ago

andreykaipov commented 7 months ago

Hi there, thank you for forking this project! Here's a small fix for something I ran into while setting this project up.

I'm on WSL and have XDG_RUNTIME_DIR set, so my nvim sockets are created there:

❯ echo $XDG_RUNTIME_DIR
/home/andrey/.run

❯ ls -1 $XDG_RUNTIME_DIR/nvim*
/home/andrey/.run/nvim.1165275.0
/home/andrey/.run/nvim.1168028.0

The existing code uses vim.loop.os_tmpdir() which works if XDG_RUNTIME_DIR is unset, but vim.fn.stdpath("run") works in both cases.

In addition, I also remove the /0 suffix in the pattern in all cases. My sockets end in .0 instead for some reason, so it might be safer to only match on .+nvim.+. Lemme know what you think!

jiriks74 commented 7 months ago

AFAIK this looks fine. I don't have WSL (or Windwows) as of now so I can't test it myself. The code seems fine so I'll merge it.

PS: Don't mind the StyLua fail it's because it needs a GitHub secret present. It's an annoying setup on their part. I'll have to deal with it.

PPS: Look into Conventional Commits. I try to use it where possible (including this repo) for better commit message readability.

Thanks for the help!

jiriks74 commented 7 months ago

OpenProject tracking code: OP#63