-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add option for bold/italic formatting #3
Conversation
@itzaeon Thank you very much for your PR! I have just a couple of minor things to comment on. I think I might prefer if the configuration API looked like this: {
highlights = {
modes = {
['i'] = {
color = colors.insert,
bold = false,
italic = false,
},
['v'] = {
color = colors.visual,
bold = false,
italic = false,
},
['V'] = {
color = colors.visual,
bold = false,
italic = false,
},
['�'] = {
color = colors.visual,
bold = false,
italic = false,
},
['s'] = {
color = colors.select,
bold = false,
italic = false,
},
['S'] = {
color = colors.select,
bold = false,
italic = false,
},
['R'] = {
color = colors.replace,
bold = false,
italic = false,
},
['c'] = {
color = colors.command,
bold = false,
italic = false,
},
}
}
} since in Neovim, the "highlght" includes italic/bold. Or what do you think? Or do you think that would make it more confusing the user to include italic/bold under the |
A quick summary of my changes:
I also added the updated |
@itzaeon Nice! However, now there's no highlight except for in normal mode for me. If I go to insert/visual/replace/etc. mode the line number indicator gets the foreground color of |
I believe I know why you experience this behavior. The two colorschemes I use are zephyr and oxocarbon. This plugin works "as designed" when I use Highlights with
And with
Note that with I see two options to fix this. 1) We can define highlight groups specifically for modicator (ie ModicatorNormalHighlight, ModicatorInsertHighlight) or 2) a new function can be added that finds different highlights for each mode. |
@itzaeon I'm not sure that's the issue I'm seeing since I explicitly set the colors in my config. I get the same problem with the following test config on your branch: use { 'melkster/modicator.nvim',
config = function()
require('modicator').setup({
highlights = {
modes = {
['i'] = 'red',
['v'] = 'green',
['V'] = 'blue',
['�'] = 'blue',
['s'] = 'yellow',
['S'] = 'brown',
['R'] = 'pink',
['c'] = 'orange',
}
},
})
end
} |
@mawkler That config won't work because it was changed here. I get the same behavior using that config, but because the config options have changed in accordance with your comment, something like this should work: use { 'melkster/modicator.nvim',
config = function()
require('modicator').setup({
highlights = {
modes = {
['n'] = { color = 'orange' },
['i'] = { color = 'red' },
['v'] = { color = 'green' },
['V'] = { color = 'blue' },
['�'] = { color = 'blue' },
['s'] = { color = 'yellow' },
['S'] = { color = 'brown' },
['R'] = { color = 'pink' },
['c'] = { color = 'orange' },
}
},
})
end
} |
@itzaeon Of course! You're right, that's my bad. |
Those should work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! The only thing I want now is for highlights.overrides
in the options table passed to setup()
to be called highlights.defaults
🙂
README.md
Outdated
-- to every mode. | ||
overrides = { | ||
bold = false, | ||
bold = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to change this one to italic
as well :)
Done! |
Awesome! Thank you very much for your contributing! 😄 |
I added the option to format line numbers with bold or italics. I changed the name of your function
M.set_highlight
toM.set_highlight_and_format
with a new parameterformat
.Note: I haven't seen the syntax
---@param color string
before, so you might have to update that for the newformat
parameter.