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

feat(transparency)!: add decoupled transparency options; #127

Merged
merged 13 commits into from
Apr 18, 2024

Conversation

5-pebbles
Copy link
Collaborator

Closes #126

You can now set the transparency of the background & floating windows separately.

The settings are now in the table transparent.
Here are the default values:

transparent = {
    bg = false,
    float = false,
},

BREAKING CHANGE: The transparent_bg option has been removed;

You can now set the transparency of the background & floating windows separately.

The settings are now in the table transparent.
Here are the default values:

```lua
transparent = {
    bg = false,
    float = false,
},
````

BREAKING CHANGE: The `transparent_bg` option has been removed;
@5-pebbles 5-pebbles self-assigned this Mar 27, 2024
@5-pebbles 5-pebbles requested a review from AlexvZyl March 27, 2024 14:21
@5-pebbles 5-pebbles added the Enhancement New feature, request or suggestion label Mar 27, 2024
@5-pebbles
Copy link
Collaborator Author

I think leaving a deprecated warning for a few weeks is a good idea.

@AlexvZyl
Copy link
Owner

I think leaving a deprecated warning for a few weeks is a good idea.

I think we can just internally keep the old value for backwards compatibility. I really do not want to break anyone's setup.

@5-pebbles
Copy link
Collaborator Author

Done & I will do the same for the on_highlight option for #124

@AlexvZyl
Copy link
Owner

@5-pebbles Take a look at :h nvim_notify. We can use that to notify the user that he is using an outdated option.

@5-pebbles
Copy link
Collaborator Author

So that would make it forward to noice.nvim not just echo it, should I add the warning back in using that?

@AlexvZyl
Copy link
Owner

So that would make it forward to noice.nvim not just echo it, should I add the warning back in using that?

It will forwrad to noice if it is setup, otherwise it will just be a normal print I believe.

@AlexvZyl AlexvZyl changed the base branch from main to dev April 14, 2024 11:41
@5-pebbles
Copy link
Collaborator Author

So, should I add the deprecated warning back in using nvim_notify?

lua/nordic/config.lua Outdated Show resolved Hide resolved
@AlexvZyl
Copy link
Owner

So, should I add the deprecated warning back in using nvim_notify?

Ah sorry, yes please.

@AlexvZyl
Copy link
Owner

AlexvZyl commented Apr 15, 2024

Also, I think we should add a file called compatibility.lua where we do all the backwards compatibility logic.

@AlexvZyl
Copy link
Owner

Also, I think we should add a file called compatibility.lua where we do all the backwards compatibility logic.

Or maybe a function in config.lua

I added a warning for transparent_bg and moved related stuff to the compatibility module.
@5-pebbles
Copy link
Collaborator Author

Also, I think we should add a file called compatibility.lua where we do all the backwards compatibility logic.

Good idea.

Or maybe a function in config.lua

I think a new file is better, config.lua is mostly defaults.

@AlexvZyl
Copy link
Owner

Do you get the notification when you use the outdated config option? Does not seem to work on my side.

Also, we should consider using vim.notify_once().

lua/nordic/compatibility.lua Outdated Show resolved Hide resolved
@5-pebbles
Copy link
Collaborator Author

Do you get the notification when you use the outdated config option? Does not seem to work on my side.

That is my mistake see: fix(deprecation): no warning if transparent_bg = false;

Also, we should consider using vim.notify_once().

Yes that would make more sense: feat(deprecation): better warning message;

@AlexvZyl
Copy link
Owner

AlexvZyl commented Apr 16, 2024

Also, you can add the title to the notification message:

vim.notify_once("...", level, {title = "nordic.nvim"})

@5-pebbles
Copy link
Collaborator Author

5-pebbles commented Apr 16, 2024

Also, you can add the title to the notification message:

vim.notify_once("...", level, {title = "nordic.nvim"})

As far as I can tell that does not effect the normal echo. So I am going to leave the title in the message as well.

The force push is because I decided to make the title Warning from nordic.nvim I think the warning part from the old title is helpful.

@5-pebbles 5-pebbles force-pushed the improved_transparency branch from aec3c15 to 07a01f6 Compare April 16, 2024 22:04
@AlexvZyl
Copy link
Owner

AlexvZyl commented Apr 17, 2024

Also, you can add the title to the notification message:

vim.notify_once("...", level, {title = "nordic.nvim"})

As far as I can tell that does not effect the normal echo. So I am going to leave the title in the message as well.

Good point, didn't think of that.

@AlexvZyl
Copy link
Owner

AlexvZyl commented Apr 17, 2024

The last thing I think we should do is change the notification based on if notify and/or noice is setup or not. But I can also do that.

@AlexvZyl
Copy link
Owner

The last thing I think we should do is change the notification based on if notify and/or noice is setup or not. But I can also do that.

Nevermind I think this is unnecessary.

@AlexvZyl
Copy link
Owner

@5-pebbles Please check my latest changes, then I think we can merge.

@5-pebbles
Copy link
Collaborator Author

Everything looks good!

Ref(compat): Remove occurnces of transparent_bg thanks for noticing this! I need to check my merges more carefully...

@AlexvZyl AlexvZyl merged commit 092fa24 into dev Apr 18, 2024
1 check passed
@AlexvZyl AlexvZyl deleted the improved_transparency branch April 18, 2024 15:00
AlexvZyl added a commit that referenced this pull request Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature, request or suggestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Background only in transparent mode
2 participants