plugins: Introduce helpers.defaultNullOpts.mkLuaFn (#855)

This allows to avoid calling `mkRaw` on lua functions, as they will get
applied automatically.

This could also help in the future to refactor the use of Lua code to
make it more user-friendly.
This commit is contained in:
traxys 2023-12-29 15:24:42 +01:00 committed by GitHub
parent b38dbdb0dc
commit 1d8e7906c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 140 additions and 119 deletions

View file

@ -59,7 +59,7 @@ in {
'';
modified =
helpers.defaultNullOpts.mkStr
helpers.defaultNullOpts.mkLuaFn
''
function(bufnr)
return vim.bo[bufnr].modified
@ -75,7 +75,7 @@ in {
'';
leadCustomSection =
helpers.defaultNullOpts.mkStr
helpers.defaultNullOpts.mkLuaFn
''
function()
return " "
@ -87,7 +87,7 @@ in {
'';
customSection =
helpers.defaultNullOpts.mkStr
helpers.defaultNullOpts.mkLuaFn
''
function()
return " "
@ -173,10 +173,10 @@ in {
show_dirname = showDirname;
show_basename = showBasename;
show_modified = showModified;
modified = helpers.mkRaw modified;
inherit modified;
show_navic = showNavic;
lead_custom_section = helpers.mkRaw leadCustomSection;
custom_section = helpers.mkRaw customSection;
lead_custom_section = leadCustomSection;
custom_section = customSection;
inherit theme;
context_follow_icon_color = contextFollowIconColor;
symbols = {