by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
TJ DeVries
@tjdevries
possible to work well, obviously
Ashkan Kiani
@norcalli
Just like how Rust and npm and a bunch of stuff has lockfiles, it would be nice to do something a little smarter.
What's "well" @tjdevries?
TJ DeVries
@tjdevries
Depends who's asking :laughing:
for me, I can specify a dep as a plugin author programatically and when a user updates my plugin, they get the dep pulled in
preferably reproducibly haha
additionally, as a user, I can require a dep somewhere in my setup and it is available for me to use in my own personal configuration
so what I'd like to do is support rockspec style items for lua plugins, and just re-use luarocks to handle everything there (detect if rockspec is in git dir, install as necessary, etc.)
I don't want to write a package manager, I just want to use lua rocks
Ashkan Kiani
@norcalli
hmm. I was thinking something else.
Anyway I'm gonna review some PRs now @clason I know you got something that's burning. @runiq you too. @tjdevries you three
Anything high priority? Otherwise I'm just going to do random stuff until I get tired.
Christian Clason
@clason
"Report to stream immediately" :)
Ashkan Kiani
@norcalli
The stream is to keep me honest.
maybe
Christian Clason
@clason
worked well last time :P
I guess the biggest thing is still the buf_set_text PR
Ashkan Kiani
@norcalli
Yeah it is.
runiq
@runiq
what @clason said
smolck
@smolck
Hmm so I tried that hot-reload thing using the package.loaded trick and it doesn't work, but I'm not really sure why . . .
It doesn't reload the module unless I restart Neovim
Wait, is it because I'm using vim-plug?
to do Plug '/path/to/nvim/plugin'
TJ DeVries
@tjdevries
nah, that won't effect it
smolck
@smolck
Any idea what could be causing it not to work? Note that if I run :lua package.loaded['the-module.name'] = nil first it works
It doesn't seem to be running the code at the top when I require the module
TJ DeVries
@tjdevries
depends how you're sourcing and requiring the thing
that's correct, I luafile the file w/ the require
and then I require it again somewhere else
smolck
@smolck

that's correct, I luafile the file w/ the require

Would you mind sharing a quick example?

TJ DeVries
@tjdevries
probably easier to just add the package.loaded stuff in the file / function you actually want to execute
I have a slightly odd workflow maybe
smolck
@smolck
Okay haha, the example @runiq showed earlier isn't working I guess is my point
@norcalli Thanks for the idea of using curl btw for HTTP stuff, using it w/jobstart and it's working well
Ashkan Kiani
@norcalli
noice @smolck
smolck
@smolck
What's a good way of maintaining state in a Lua plugin? Just using globals or . . .?
TJ DeVries
@tjdevries
I mean, you can use a local variable declared at the module level (so it's scoped to your module) to do it
idk what kind of state you're trying to maintain, so it's hard to give a strong recommendation
smolck
@smolck
I'd like to maintain a state w/todoist tasks and some info about them
for example if the user checks a task, I'd like to store that somewhere so I can query the Todoist API at some point in the future telling it to complete said task
well actually probably won't do that
but I think I'd like to keep a list of the tasks regardless ;)
I could then potentially use their sync API, but I've been avoiding that because I think the REST API's easier to deal with
TJ DeVries
@tjdevries
you want the state to be maintiained between different sessions?
smolck
@smolck
Like different sessions of Neovim?
TJ DeVries
@tjdevries
yeah
smolck
@smolck
That'd probably be ideal, but I'm not too worried about that
But if it's not that difficult to do, then that's probably a good idea
TJ DeVries
@tjdevries
ha, it's more difficult for sure. I'm not exactly sure what you mean, but I gotta run
smolck
@smolck
Okay, later!