@@ -8,7 +8,6 @@ Async Await in [90 lines](https://github.com/ms-jpq/neovim-async-tutorial/blob/m
88
99[ svermeulen] ( https://github.com/svermeulen ) for fixing [ inability to return functions] ( https://github.com/ms-jpq/neovim-async-tutorial/issues/2 ) .
1010
11-
1211This tutorial assumes that you are familiar with the concept of ` async ` ` await `
1312
1413You will also need to read through the [ first 500 words] ( https://www.lua.org/pil/9.1.html ) of how coroutines work in lua.
@@ -62,7 +61,7 @@ To avoid confusion, I will follow the convention used in the Lua book, and use `
6261``` lua
6362local co = coroutine
6463
65- local thread = co .create (function ()
64+ local thread = co .create (function ()
6665 local x , y , z = co .yield (something )
6766 return 12
6867end )
@@ -201,7 +200,6 @@ Notice that we also make pong call a callback once it is done.
201200
202201We can see it in action here:
203202
204-
205203``` lua
206204local echo = function (...)
207205 local args = {... }
@@ -211,7 +209,7 @@ local echo = function (...)
211209 return thunk
212210end
213211
214- local thread = co .create (function ()
212+ local thread = co .create (function ()
215213 local x , y , z = co .yield (echo (1 , 2 , 3 ))
216214 print (x , y , z )
217215 local k , f , c = co .yield (echo (4 , 5 , 6 ))
@@ -268,7 +266,7 @@ All this explicit handling of coroutines are abit ugly. The good thing is that w
268266
269267Simply wrap the coroutine interface with some friendly helpers
270268
271- ``` lua
269+ ``` lua
272270local pong = function (func , callback )
273271 local thread = co .create (func )
274272 ...
@@ -317,12 +315,11 @@ a.sync(function ()
317315end )()
318316```
319317
320-
321318## Plugin!
322319
323320I have bundle up this tutorial as a vim plugin, you can install it the usual way.
324321
325- ` Plug 'ms-jpq/neovim-async-tutorial' `
322+ ` Plug 'ms-jpq/neovim-async-tutorial', {'branch': 'neo'} `
326323
327324and then call the test functions like so:
328325
@@ -333,4 +330,3 @@ and then call the test functions like so:
333330` :LuaTextlockFail `
334331
335332` :LuaTextLockSucc `
336-
0 commit comments