Merge pull request #97 from iton0/main

feat: add enabled field for styles class
This commit is contained in:
Max Del Canto 2024-09-19 10:32:09 -03:00 committed by GitHub
commit 5c9c2a45b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View file

@ -271,6 +271,13 @@ require('solarized').setup({
})
```
You can also disable all highlight group styles.
```lua
require('solarized').setup({
styles = { enabled = false } },
})
```
## Config Highlights
The `highlights` config allows you to customize the highlights groups.

View file

@ -11,6 +11,7 @@
---@field enabled? boolean
---@class solarized.styles
---@field enabled? boolean
---@field types? vim.api.keyset.highlight
---@field functions? vim.api.keyset.highlight
---@field parameters? vim.api.keyset.highlight
@ -89,6 +90,7 @@ return {
symbol = false,
},
styles = {
enabled = true,
types = {},
functions = {},
parameters = {},

View file

@ -10,6 +10,19 @@ M.config = require 'solarized.config'
M.setup = function(config)
M.config = vim.tbl_deep_extend('force', M.config, config)
if M.config.styles.enabled == false then
M.config.styles = {
types = { italic = false, bold = false },
functions = { italic = false, bold = false },
parameters = { italic = false, bold = false },
comments = { italic = false, bold = false },
strings = { italic = false, bold = false },
keywords = { italic = false, bold = false },
variables = { italic = false, bold = false },
constants = { italic = false, bold = false },
}
end
end
M.load = function()