Skip to content

Commit 11b65d0

Browse files
committed
feat(config): Added some extra description types
These are, - `code`, For foldijg chunks of code. - `chunk`, Same as `code`. - `func`, For folding function bodies. - `method`, For folding method bodies or methods. - `var`, For folding variable definitions. Usage, ```lua --{{{ "var: Default variables" local a = 1; local b = 2; --}}} ```
1 parent f11adec commit 11b65d0

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

lua/foldtext/parts.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,34 @@ parts.description = function (buffer, _, config)
183183
icon_hl = "DiagnosticError",
184184
},
185185

186+
187+
code = {
188+
icon = "󰁤 ",
189+
icon_hl = "Constant",
190+
},
191+
192+
func = {
193+
icon = "󰡱 ",
194+
icon_hl = "Function",
195+
},
196+
197+
method = {
198+
icon = "󰡱 ",
199+
icon_hl = "@method",
200+
},
201+
202+
var = {
203+
icon = "󰏖 ",
204+
icon_hl = "@variable.builtin",
205+
},
206+
186207
---|fE
187208
}, config.styles or {});
188209

210+
if not config.styles then
211+
kind_styles.chunk = kind_styles.code;
212+
end
213+
189214
local function kind_style (kind)
190215
return vim.tbl_extend("force", kind_styles.default, kind_styles[kind] or {});
191216
end

0 commit comments

Comments
 (0)