Replies: 4 comments 21 replies
-
Still struggling to make this happen. Based on this recipe I tried the following but I'm still seeing copilot and dynamic snippet options in the blink suggestions when I'm in a comment block in Ruby or Lua code:
I'm using LazyVim if that matters. Everything is up-to-date. My full configuration is here. |
Beta Was this translation helpful? Give feedback.
-
Interested too |
Beta Was this translation helpful? Give feedback.
-
I DO NOT HAVE THE ANSWER...
|
Beta Was this translation helpful? Give feedback.
-
Seems to work good for me simply checking the spot 1 space to the left of the cursor! auto_show = function (ctx)
local row, column = unpack(vim.api.nvim_win_get_cursor(0))
local success, node = pcall(vim.treesitter.get_node, {
pos = { row - 1, math.max(0, column - 1) },
ignore_injections = false
})
local reject = { "comment", "line_comment", "block_comment", "string_start", "string_content", "string_end" }
if success and node and vim.tbl_contains(reject, node:type()) then
return false;
end
-- whatever other logic you want beyond this
return true
end, I've only tested this fully in Zig |
Beta Was this translation helpful? Give feedback.
-
I used to do this in
nvim-cmp
with some function logic on theenable
option like this:I'm trying to recreate this for blink but I can't seem to detect a comment. I've got this so far:
The:
doesn't seem to work correctly. And
enabled
doesn't seem to fire for every treesitter context change.Is there a way to do this?
I'm using blink via LazyVim if that makes a difference.
Beta Was this translation helpful? Give feedback.
All reactions