Skip to content

Commit

Permalink
add @async
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorias committed Nov 23, 2024
1 parent 5d6226a commit d8721f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _posts/2024-10-20-using-coroutines-in-neovim-lua.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ They are also “contagious.”
Using a coroutine function inside a function makes the function into a
coroutine function, so it’s good to document that.
It’s a good practice to indicate that a function may yield by, for example,
adding a `_co` suffix.
adding a `_co` suffix or
[using the `@async` LuaLS annotation](https://luals.github.io/wiki/annotations/#async).

We can use the coroutine functions _almost_ like a regular function by wrapping
it with a thread:
Expand Down

0 comments on commit d8721f0

Please sign in to comment.