fix(lazygit): enable boolean values in config (#377)

## Description

Using boolean value inside `config` resulted in error `attempt to
concatenate a boolean value` inside `to_yaml` function.
This PR fixes it by converting boolean values to string

Example config:
```
lazygit = {
    config = {
        gui = {
            showFileTree = false,
        },
    },
},
```
## Related Issue(s)

## Screenshots

![image](https://github.com/user-attachments/assets/eea8eec6-2008-4ded-9222-6f7c9b9d4390)
This commit is contained in:
NevLext 2024-12-31 06:22:31 +01:00 committed by GitHub
parent 7861e62ad0
commit ec346843e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,6 +156,9 @@ local function update_config(opts)
local config = vim.tbl_deep_extend("force", { gui = { theme = theme } }, opts.config or {})
local function yaml_val(val)
if type(val) == "boolean" then
return tostring(val)
end
return type(val) == "string" and not val:find("^\"'`") and ("%q"):format(val) or val
end