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

Auto disable when buffer is diff #20

Open
componhead opened this issue Jun 4, 2024 · 4 comments · May be fixed by #22
Open

Auto disable when buffer is diff #20

componhead opened this issue Jun 4, 2024 · 4 comments · May be fixed by #22
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@componhead
Copy link

componhead commented Jun 4, 2024

Hi.
Is it possible? How (aside aucmd in plugin setup)

thank you

@miversen33 miversen33 self-assigned this Jun 4, 2024
@miversen33
Copy link
Owner

Good question! I have no idea, I will have to investigate this. I initially thought it was just a buftype but it seems that is not the case. Probably some special shenanigans that need to be done to check for this.

@miversen33 miversen33 added enhancement New feature or request good first issue Good for newcomers labels Jun 4, 2024
@miversen33
Copy link
Owner

miversen33 commented Jun 4, 2024

A check would need to be added for the window value 'diff'. Something like

if vim.api.nvim_get_option_value('diff', { win = 0 } ) then
    -- Do a thing to prevent sunglasses from actioning this window
end

There is nothing like this in sunglasses currently, this would be a PR. If you are comfortable doing so, feel free to poke about in window:can_shade, that is where this logic would go.

An option would need to be added to enable this as well. IMO even though 'diff' is special, I think we can still cheese it and add 'diff' as a defaulted excluded filetype. Though I will leave that decision up to the implementer which may or may not be me sometime in the future.

Lastly, this option is something that IMO should be enabled by default

@componhead
Copy link
Author

Thank you. I'll see how to resolve. For now I adopt the aucmd suboptimal solution.

@miversen33 miversen33 reopened this Jun 5, 2024
@miversen33
Copy link
Owner

That makes sense. I am reopening this as this is a feature that sunglasses should have

@yujinyuz yujinyuz linked a pull request Jul 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants