Skip to content

Commit

Permalink
feat: #58 add spell highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Jul 14, 2022
1 parent 1f1e422 commit 6007bed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/onedarkpro/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ local function default_hlgroups()
diffFile = { fg = theme.colors.yellow },
diffNewFile = { fg = theme.colors.yellow },
diffLine = { fg = theme.colors.blue },

-- Spelling
SpellBad = { fg = theme.colors.red, style = theme.options.undercurl_underline },
SpellCap = { fg = theme.colors.red, style = theme.options.undercurl_underline },
SpellLocal = { fg = theme.colors.red, style = theme.options.undercurl_underline },
SpellRare = { fg = theme.colors.red, style = theme.options.undercurl_underline },
}
end

Expand All @@ -175,8 +181,9 @@ local function set_options()
return {
bold = theme.config.options.bold and "bold" or "NONE",
italic = theme.config.options.italic and "italic" or "NONE",
underline = theme.config.options.underline and "underline" or "NONE",
undercurl = theme.config.options.undercurl and "undercurl" or "NONE",
underline = theme.config.options.underline and "underline" or "NONE",
undercurl_underline = (theme.config.options.undercurl and "undercurl" or (theme.config.options.underline and "underline" or "NONE")),
bold_italic = (bold ~= "NONE" and italic ~= "NONE") and "bold,italic" or "NONE",
cursorline = (theme.config.options.cursorline or theme.config.options.highlight_cursorline)
and theme.colors.cursorline
Expand Down

5 comments on commit 6007bed

@petobens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @olimorris! After this change if I have a word that is normally higlighted in, for instance, blue but happens to be misspelled then it becomes red. Can you simply set the gui-sp rather than a fg color as in:

SpellBad = { sp = p.red, style = 'undercurl' },

so as to respect the original "blue" color but underline/undercurl in red? I think it makes more sense. Thanks!

@petobens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a related note: if I indeed set a custom highlight config (in muy hlgroups) with simply:

SpellBad = { sp = p.red, style = 'undercurl' },

then the foreground color of a spelling mistake is still red (rather than only the only curl). Is this a feature or a bug? I would've the user config to take precedence over the global/plugin config.

@olimorris
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great spot! Will fix later today

@olimorris
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But custom highlight groups should take priority over the theme's. I will look into this too. Needless to say I have loads of custom hl groups in my dot files. Could you open up an issue with your config?

@petobens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But custom highlight groups should take priority over the theme's. I will look into this too. Needless to say I have loads of custom hl groups in my dot files. Could you open up an issue with your config?

I believe this might be related to the issue I opened in #48

Please sign in to comment.