You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+53
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,59 @@
2
2
3
3
## Pre-release
4
4
5
+
## 8.0.0 (2025-02-06)
6
+
7
+
### ⚠ BREAKING CHANGES
8
+
9
+
This release includes only a single change which breaks any function values in user
10
+
configurations. Rather than passing a list of arguments to the functions we now
11
+
provide a single context table with the same information [591e256](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/591e2561a7236501a7e9ae88ebd9362d07a8c4a3).
12
+
13
+
The fix to any errors is straightforward as the fields of the context continue to
14
+
have the same names. So if you have an existing function like:
15
+
16
+
```lua
17
+
function(param1, param2)
18
+
vim.print(param1)
19
+
vim.print(param2)
20
+
end
21
+
```
22
+
23
+
The fixed version would be:
24
+
25
+
```lua
26
+
function(ctx)
27
+
vim.print(ctx.param1)
28
+
vim.print(ctx.param2)
29
+
end
30
+
```
31
+
32
+
If you use the same parameters many times in the function and don't want to add the
33
+
`ctx.` prefix everywhere you can add a line at the top to define local variables
34
+
with the same name as before and keep the rest of the function body unchanged:
35
+
36
+
```lua
37
+
function(ctx)
38
+
localparam1, param2=ctx.param1, ctx.param2
39
+
vim.print(param1)
40
+
vim.print(param2)
41
+
end
42
+
```
43
+
44
+
The fields impacted are:
45
+
46
+
- The `parse` functions in `custom_handlers`:
47
+
-`buf` -> `ctx.buf`
48
+
-`root` -> `ctx.root`
49
+
- The callbacks in `on`: `on.attach` & `on.render`:
50
+
-`buf` -> `ctx.buf`
51
+
-`bullet.icons` & `bullet.ordered_icons` if a non-default function was set:
0 commit comments