-
Notifications
You must be signed in to change notification settings - Fork 43
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
FR: Customize highlight group #49
Comments
Is this the expected behaviour @chrisgrieser? Warning Flashbang start 👍🏼 switching-from-light-to-dark.mp4My current config (using lazy.nvim) -- path/to/plugins/supermaven.lua
return {
"supermaven-inc/supermaven-nvim",
lazy = false,
config = function()
require("supermaven-nvim").setup({
keymaps = {
accept_suggestion = "<S-Tab>",
},
color = {
suggestion_color = "#DC8CE2",
cterm = 117,
},
})
end,
} |
Not sure what you mean, but from the config in your video, I actually figured out that the respective highlight group is exported and can therefore be configured via this: require("supermaven-nvim.completion_preview").suggestion_group So for me personally, this solves it, though nonetheless it would be more user-friendly, if the highlight group could be customizable directly in the settings. |
What I meant is that with the config I am using it detects the color I changed it to be even when changing from a dark colorscheme to a light one. My question would be, if what you want is to persist the same color for both dark and light or change them depending on the colorscheme. From what I am understanding is that you want for example the ghost text to be link to for example the group If that is the case I think of 2 simple solutions.
|
Exposing |
@chrisgrieser I made the changes in #51, tell your thoughts about it and test it if you want. |
@AlejandroSuero thanks for the implementation! There seems to be an issue that initially, supermaven uses the wrong color, a problem that does not occur when I use I think when supermaven is loaded after the colorscheme is set, the callback here is never called. However, when loading the colorscheme after supermaven has been loaded, the correct color is displayed. I think running the callback function once on manually on initialization might solve this already. |
@chrisgrieser I logged out the callback with: print("setting suggestion group")
print(config.color.suggestion_group) Here are the results: suggestion_group-log.mp4Is getting called in every When logging out the event I get the following: setting suggestion group NonText
event {
buf = 1,
event = "ColorScheme",
file = "",
group = 18,
id = 46,
match = "astrodark"
}
setting suggestion group NonText
event {
buf = 1,
event = "VimEnter",
file = "",
group = 18,
id = 46,
match = ""
} Every time the colorscheme is change it will call the callback function with the |
@chrisgrieser if I change my plugin to load on I am going to ask in the PR itself if I should change it so it can be load with that behaviour in mind or create another PR with those changes. |
Currently, we can customize the color of the ghost text suggestions via
color
in the setup call. (which, btw, is not working for me.) However, that is quite inflexible. For instance, I switch between two themes (light/dark mode), and one color that works in light mode does not work well in dark mode.A solution for this would be to simply let users link a Highlight group that the suggestions should use. That way, the appearance of the suggestions should follow whatever theme the user switches to. It's also what other plugins commonly do to solve that problem.
The text was updated successfully, but these errors were encountered: