-
Notifications
You must be signed in to change notification settings - Fork 4
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
Yet another configurable shade callback #28
base: main
Are you sure you want to change the base?
Conversation
Thank you for this! It will be a bit before I can test and review as I'm currently on holiday. I'll try to get around to it this weekend :) |
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.
I like this PR :) Its simple, the doc is clear and the logic is easy to follow.
I think we should make can_shade_callback
use the provided example as its default (called out in a separate review) but otherwise this is good and I feel after that change, its ready for merge :)
README.md
Outdated
-- lua | ||
local sunglasses_options = { | ||
can_shade_callback = function(opts) | ||
local conditions = { |
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.
I like making this part of sunglasses_defaults
IE, by default users will have diffs "optionally" unshaded, though they can modify that logic if they choose. (by overriding this value in the provided default)
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.
That's a great idea!
Suggested changes are in 793b4b5.
Sorry if this is beating a dead horse, but I knew I was wanting similar functionality to what was suggested in #20, #22, and #27. I'm using this primarily to ignore diff files but wanted to make it relatively extensible.
Let me know what you think!