Skip to content

Commit b5f8191

Browse files
ms-jpqs1n7ax
authored andcommitted
prettier
1 parent aca717c commit b5f8191

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
1211
This tutorial assumes that you are familiar with the concept of `async` `await`
1312

1413
You 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
6362
local 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
6867
end)
@@ -201,7 +200,6 @@ Notice that we also make pong call a callback once it is done.
201200

202201
We can see it in action here:
203202

204-
205203
```lua
206204
local echo = function (...)
207205
local args = {...}
@@ -211,7 +209,7 @@ local echo = function (...)
211209
return thunk
212210
end
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

269267
Simply wrap the coroutine interface with some friendly helpers
270268

271-
```lua
269+
```lua
272270
local pong = function (func, callback)
273271
local thread = co.create(func)
274272
...
@@ -317,12 +315,11 @@ a.sync(function ()
317315
end)()
318316
```
319317

320-
321318
## Plugin!
322319

323320
I 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

327324
and 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

Comments
 (0)