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

Error when opening Telescope for the first time in a session #11

Open
ayepezcalderon opened this issue Mar 9, 2024 · 0 comments
Open

Comments

@ayepezcalderon
Copy link

ayepezcalderon commented Mar 9, 2024

After installing cmp-dap, when I try to open Telescope for the first time in an nvim session, the Telescope prompt immediately closes. Subsequent attempts to open Telescope work fine, but it is annoying to get buggy behavior on the first attempt.

I fixed this by using the following enabled function instead of the one given in the README:

enabled = function()
  local disabled = false
  disabled = disabled or (vim.api.nvim_buf_get_option(0, 'buftype') == 'prompt'
      and not require("cmp_dap").is_dap_buffer())
  disabled = disabled or (vim.fn.reg_recording() ~= '')
  disabled = disabled or (vim.fn.reg_executing() ~= '')
  return not disabled
end,

The enabled function above is the default enabled function of nvim-cmp, with the only exception that this line

disabled = disabled or (vim.api.nvim_buf_get_option(0, 'buftype') == 'prompt')

was replaced with this line

disabled = disabled or (vim.api.nvim_buf_get_option(0, 'buftype') == 'prompt'
    and not require("cmp_dap").is_dap_buffer())

I suggest to update the README with the above enabled function instead of the current one, which is causing the issue I described earlier with Telescope (and probably other "prompt" buftypes).

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

No branches or pull requests

1 participant