Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Expand user config to also deal with user specified style (bold / italics) setting #113

Closed
janislaus opened this issue Jan 7, 2023 · 3 comments · Fixed by #114
Assignees

Comments

@janislaus
Copy link

janislaus commented Jan 7, 2023

Hi,
great theme. It would be great to also be able to specify the style (bold / italic) for text in the setup function.

It already works, if the given highlight group does not already have a specified style. However, if for example the following is passed to the setup function:
highlight_groups = { ['@method'] = { bg = 'rose', style = 'bold'}, ... }
Here '@method' is already in italics. The result is, that '@method' will be both italic and bold.

Desired behavior:
The style specified by the user takes precedence over the preconfigured style.

@janislaus janislaus changed the title [Feature Request] Expand blend function to also deal with user specified style (bold / italics) setting [Feature Request] Expand user config to also deal with user specified style (bold / italics) setting Jan 7, 2023
@mvllow
Copy link
Member

mvllow commented Jan 8, 2023

I'm curious if moving to the newer highlight api would solve this, e.g:

- ['@method'] = { bg = 'rose', style = 'bold' }
+ ['@method'] = { bg = 'rose', bold = true, italic = false }

In the example above I explicitly disabled italic but I'm actually not sure if that would be necessary. Will play around with it though :)

@mvllow mvllow self-assigned this Jan 8, 2023
@mvllow
Copy link
Member

mvllow commented Jan 8, 2023

Highlight api has been updated on the canary branch. Your overrides should now replace existing highlights entirely, e.g:

require("rose-pine").setup({
  highlight_groups = {
    ["@method"] = { bg = "rose", bold = true },
  },
})

Keep in mind that for the above example, a highlight group could be both @method and @variable – meaning @variable (which is italic by default) would also need overridden.

On a side note, you could disable all italics to begin with via disable_italics = true.

@janislaus
Copy link
Author

Thanks for the fix. The canary branch does exactly what I wanted ;)

@mvllow mvllow mentioned this issue Jan 8, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants