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: added disabled_when config option #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Poulbi
Copy link

@Poulbi Poulbi commented Sep 19, 2024

Enables to create your own custom conditions by executing a function if it is present in the table. The function should return true when the pair is disabled and nil or false when not.

I made this so that I could disable certain pairs when in comments with this snippet:

local function in_comment()
	if
		require("cmp.config.context").in_treesitter_capture("comment") == true
		or require("cmp.config.context").in_syntax_group("Comment")
	then
		return true
	else
		return false
	end
end

Enables to create your own custom conditions by executing a function if it is
present in the table.  The function should return true when the pair
is disabled and nil or false when not.
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.

1 participant