Skip to content

Commit

Permalink
fix: regression in options (#221)
Browse files Browse the repository at this point in the history
* fix: headings not migrating to flat options

* fix: invalid key when using inherit
  • Loading branch information
mvllow authored Jan 27, 2024
1 parent bf00df1 commit 14b371f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lua/rose-pine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,10 @@ local function set_highlights()
end

if (highlight.inherit == nil or highlight.inherit) and existing ~= nil then
highlight.inherit = nil
parsed.inherit = nil
highlights[group] = vim.tbl_extend("force", existing, parsed)
else
highlight.inherit = nil
parsed.inherit = nil
highlights[group] = parsed
end
end
Expand Down
18 changes: 8 additions & 10 deletions lua/rose-pine/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,21 @@ local function migrate(options)

-- Set h1 through h6 to the same color if only one is specified
if type(options.groups.headings) == "string" then
options.groups.headings = {
h1 = options.groups.headings,
h2 = options.groups.headings,
h3 = options.groups.headings,
h4 = options.groups.headings,
h5 = options.groups.headings,
h6 = options.groups.headings,
}
end
if type(options.groups.headings) == "table" then
options.groups.h1 = options.groups.headings
options.groups.h2 = options.groups.headings
options.groups.h3 = options.groups.headings
options.groups.h4 = options.groups.headings
options.groups.h5 = options.groups.headings
options.groups.h6 = options.groups.headings
elseif options.groups.headings == "table" then
options.groups.h1 = options.groups.headings.h1 or options.groups.h1
options.groups.h2 = options.groups.headings.h2 or options.groups.h2
options.groups.h3 = options.groups.headings.h3 or options.groups.h3
options.groups.h4 = options.groups.headings.h4 or options.groups.h4
options.groups.h5 = options.groups.headings.h5 or options.groups.h5
options.groups.h6 = options.groups.headings.h6 or options.groups.h6
end
options.groups.headings = nil

return options
end
Expand Down

0 comments on commit 14b371f

Please sign in to comment.