-
Notifications
You must be signed in to change notification settings - Fork 151
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
disable blink.cmp remaps when telescope prompt is open #104
disable blink.cmp remaps when telescope prompt is open #104
Conversation
Confirmed that this resolves the issue for me! |
Hope to add ignore_buffer_type to the configuration options |
Could be a good idea to also make the excluded file types be configurable by the user? |
@Jezda1337 won't it be better to make a map: filetype -> bool instead of iterating over excluded filetypes? |
… filetypes - Implemented `exclude_filetypes` as a config option with default values (`TelescopePrompt` - Improved performance by using a map for filetype lookups instead of iterating over a list - Keymaps are now disabled for buffers matching the excluded filetypes)
Thank you for the suggestions. I have implemented them as you suggested. Cheers! |
My only qualm with this is that the config option gives the impression the plugin will be disabled for the file types inside the table. This might cause some confusion. Does it make more sense to turn off blink entirely than just the keymaps? |
Thanks for the PR! Like Scott said, the triggers should also be disabled and the table should be array-like instead of a key = true |
Seems like utils.is_special_buffer() would handle this case without a dedicated blocklist fyi |
This would have the added benefit of closing #52. Probably out of scope for this PR, but we should also think about extending this functionality with user commands like Exposing these via lua APIs would also be useful for custom user functionality for the plugin too. |
potential approach for Saghen#104
- Implemented autocommand for BufEnter and InsertEnter events to disable the plugin dynamically for specific file types. - Added a global variable `vim.g.blinkcmp_enabled` to track whether the plugin is enabled. - Updated relevant parts of the plugin to return early if the plugin is disabled for a file type.
@scottmckendry @Saghen I have updated PR based on Scott's example. Since |
@Jezda1337 great stuff! That approach made more sense when used with the This would remove the need to set a global variable for buffer-specific logic as well as the extra autocmd in |
…special_buffer() for buffer handling
@scottmckendry Hey, thanks for the suggestions. I have applied them all. Please feel free to check and ask for additional changes if you need them. I have tested and everything works as before. Cheers! |
@Jezda1337 thanks for your efforts! I've merged with a couple of minor changes. |
resolves Saghen#102 * disable blink.cmp remaps when telescope prompt is open * make it a bit cleaner * implemented iteration over exclude_filetypes table * add `exclude_filetypes` config option to disable keymaps for specific filetypes - Implemented `exclude_filetypes` as a config option with default values (`TelescopePrompt` - Improved performance by using a map for filetype lookups instead of iterating over a list - Keymaps are now disabled for buffers matching the excluded filetypes) * add dynamic plugin disabling based on file type - Implemented autocommand for BufEnter and InsertEnter events to disable the plugin dynamically for specific file types. - Added a global variable `vim.g.blinkcmp_enabled` to track whether the plugin is enabled. - Updated relevant parts of the plugin to return early if the plugin is disabled for a file type. * remove old unused code * refactor: remove blinkcmp_enabled flag and directly utilize utils.is_special_buffer() for buffer handling * refactor: remove extra calls to is_special_buffer where logic already exists --------- Co-authored-by: Scott McKendry <[email protected]>
close #102