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

[Bug]: Disabling mouse commands is unintuitive due to vim.tbl_deep_extend() #705

Closed
1 task done
durka opened this issue Mar 11, 2023 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@durka
Copy link

durka commented Mar 11, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I wanted to disable the right mouse click action.

Because the user-provided config is merged with the defaults, setting an option to nil has no effect. For example

require("bufferline").setup{ config = { right_mouse_command = nil }}

This surprisingly (from a user perspective) does not actually disable the right mouse command, because the merge uses the default value which is not nil.

A workaround is to set the command to '' instead of nil.

I'm not sure there is any solution, maybe just a note in the documentation that putting a nil in the config will have no effect and to use '' instead in this situation.

What did you expect to happen?

Since I saw

right_mouse_command = 'bdelete! %',
middle_mouse_command = nil,

in the default options, I thought I could simply swap the values to switch the commands. But I had to replace nil with '' as explained above.

Config

require("bufferline").setup{ config = { right_mouse_command = nil }}

Additional Information

No response

commit

No response

@durka durka added the bug Something isn't working label Mar 11, 2023
akinsho added a commit that referenced this issue Mar 11, 2023
@akinsho
Copy link
Owner

akinsho commented Mar 11, 2023

Yeah in the case of user configurations setting things to nil is unfortunately not a good way to indicate that it isn't wanted for the reason specified above. You can also use false as a value to prevent the command being run. I've added a note to the docs on the dev branch

@akinsho akinsho closed this as completed Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants