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: docs/en/indent.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,24 @@ When rendering, the first level will use the first character, the second level w
40
40
41
41
-`delay` is a number that presents a millisecond value, because rendering is very time-consuming in some cases, a throttle function is used to limit the rendering frequency, the larger the value, the smoother the screen scrolling, but at the same time, a larger part of the content will not be rendered (until after delay milliseconds), which defaults to 100
42
42
43
+
-`filter_list` is a `Lua` list where you can define some `filter` functions to filter the rendered characters. The functions defined here must accept one parameter, `render_char_info`, which contains the following fields:
44
+
-`level`: indicates the current indentation level
45
+
-`lnum`: indicates the line number where the current indented character is located (starting from 0)
46
+
-`virt_text_win_col`: represents the column on the screen where the current indented character is located (starting from 0). For more information, refer to [nvim_buf_set_extmark function](https://neovim.io/doc/user/api.html#nvim_buf_set_extmark())
47
+
-`virt_text`: same as above, this is a parameter of the `nvim_buf_set_extmark` function; generally, you do not need to set this field.
48
+
49
+
let's look an example here, if you don't want to show the first level of indent line, you can set like this:
50
+
51
+
```lua
52
+
filter_list= {
53
+
function(v)
54
+
returnv.level~=1
55
+
end,
56
+
},
57
+
```
58
+
59
+
60
+
43
61
Like chunk, we also need to pay extra attention to the common configuration style:
44
62
45
63
- Here, style is a RGB string or a table. If it is a string, all indent lines will be rendered in this color. If it is a table, it can be written in two ways:
0 commit comments