-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Provide custom palette directly to neogit #153
Conversation
lua/cyberdream/extensions/neogit.lua
Outdated
@@ -5,28 +5,34 @@ local M = {} | |||
--- @param t CyberdreamPalette | |||
function M.get(opts, t) | |||
opts = opts or {} | |||
local neogit = require("neogit") |
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.
We need to check if neogit
can be loaded before we try to require it. If you don't have the plugin installed, it breaks cyberdream:
Failed to run `config` for cyberdream.nvim
vim/_editor.lua:0: /home/scott/git/nix/nvim/init.lua..nvim_exec2() called at /home/scott/git/nix/nvim/init.lua:0../home/scott/git/cyberdream.nvim/colors/cyberdream.lua: Vim(colorscheme):E5113: Error while calling lua chunk: ...git/cyberdream.nvim/lua/cyberdream/extensions/neogit.lua:8: module 'neogit' not found:
no field package.preload['neogit']
local neogit = require("neogit") | |
if not package.loaded["neogit"] then | |
return {} | |
end | |
local neogit = require("neogit") |
Hey @gldtn! Thanks for your PR 🙂 Aside from the issue with the
Is there any reason why using the built-it Neogit highlight groups isn't an option here? |
The whole reason I changed to the built-in hl groups was to not have to set each group individually and let neogit take care of the rest by simply passing cyberdream colors to it. I did not think about the possible loading issues as you described above. I believe in order to not require neogit I would maybe have to somewhat replicate some of the items in the Let me see what I can come up with when I get home today and I'll give you an update. |
You could use Cattpuccin's implementation as a reference: You probably won't need to define all highlight groups; most default links should be fine to leave as is. They use If you want to do something similar you can use |
This removes Question, when you set Cyberdream with For example: To avoid this I set it to I noticed this behavior when customizing my fzf-lua/telescope, I can open a issue to show screenshots if necessary. Thanks! |
Great stuff @gldtn 🙂 thanks again for contributing to the project! |
Better integration with Neogit custom palette: https://github.com/NeogitOrg/neogit/blob/0820552997dd4dda4faa147228f0e61ea88290a3/doc/neogit.txt#L563