Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

qmrodgers
Copy link

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!

@miversen33
Copy link
Owner

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 :)

Copy link
Owner

@miversen33 miversen33 left a 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 = {
Copy link
Owner

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)

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants