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

Add basic event trigger API #31

Merged
merged 3 commits into from
Oct 11, 2024
Merged

Conversation

dsully
Copy link
Contributor

@dsully dsully commented Oct 8, 2024

This allows for copilot.lua (and others I'm sure) ghost text to be hidden when the completion menu is shown:

            -- Remove Copilot ghost text when the cmp menu is opened.
            ev.on_load("blink.cmp", function()
                vim.schedule(function()
                    local cmp = require("blink.cmp")

                    cmp.on_show(function()
                        require("copilot.suggestion").dismiss()
                        vim.api.nvim_buf_set_var(0, "copilot_suggestion_hidden", true)
                    end)

                    cmp.on_hide(function()
                        vim.api.nvim_buf_set_var(0, "copilot_suggestion_hidden", false)
                    end)
                end)
            end)

I'm not sure of the best place to document this at the moment.

Fix some typos and syntax issue in the README as well.

@Saghen
Copy link
Owner

Saghen commented Oct 8, 2024

I believe you're looking to track the cmp.autocomplete window's visibility instead of the trigger. Also please add back the new lines on the recommended configuration. Thanks for the grammar fixes on the rest of the README 😄

@dsully
Copy link
Contributor Author

dsully commented Oct 9, 2024

You're right - let me update.

@dsully dsully force-pushed the dsully/event-triggers branch 2 times, most recently from 7a95c5a to aba9921 Compare October 9, 2024 13:03
@dsully
Copy link
Contributor Author

dsully commented Oct 9, 2024

Done.

I added additional type hints, and I also left my changes to the trigger.event_triggers.

Let me know if you'd like those reverted.

@dsully dsully force-pushed the dsully/event-triggers branch from aba9921 to f6fa4f9 Compare October 11, 2024 01:10
@Saghen
Copy link
Owner

Saghen commented Oct 11, 2024

Yeah, would be great if you could revert the changes to signature help and trigger. I'll end up extracting the event targets into their own module for #82

@Saghen Saghen merged commit 127f518 into Saghen:main Oct 11, 2024
@Saghen
Copy link
Owner

Saghen commented Oct 11, 2024

Thank you!

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