Skip to content

Commit f2bdf9f

Browse files
chore(release): 8.0.0
1 parent 591e256 commit f2bdf9f

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

CHANGELOG.md

+53
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,59 @@
22

33
## Pre-release
44

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+
local param1, 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:
52+
- `level` -> `ctx.level`
53+
- `index` -> `ctx.index`
54+
- `value` -> `ctx.value`
55+
- `heading.icons` if a function was set:
56+
- `sections` -> `ctx.sections`
57+
558
## 7.9.0 (2025-02-02)
659

760
### Features

0 commit comments

Comments
 (0)